Is there a way to do certificate pinning on the ap...
# apollo-kotlin
r
Is there a way to do certificate pinning on the apollo-kotlin
ApolloClient
? (i.e. with out OkHttp for multi-platform)
m
I don't think there's anything builtin. You'd have to do expect/actual and configure
NSUrlSession
/`OkHttp` separately
r
ok so for multiplatform i would have to implement the HttpEngine interface and use
NSUrlSession
/`OkHttp` individually i guess?
m
Yep, that'd be the way to go
r
thanks ­čÖé
m
Sure thing!
Ultimately, I think an answer to this question could be to provide a HttpEngine based on Ktor so that you can configure Ktor in a single place instead of having to configure OkHttp/NSUrlSession
(assuming Ktor supports certificate pinning but sounds like something it should support
r
yes that might be a better option actually then its KMP compatible if it needs to be reused for other platforms too
m
might not be too hard to do given that we use Ktor for JS
r
do you think it would be possible/good to support at the
ApolloCilent.Builder
level?
as im just using the
DefaultHttpEngine
atm
m
do you think it would be possible/good to support at the
ApolloCilent.Builder
level?
I think we'd need something like
Copy code
ApolloClient.Builder().httpEngine(ktorEngine)
Where
KtorEngine
is an Apollo-provided wrapper around Ktor
r
yes true
m
Maybe it's a matter of taking the JS HttpEngine and making it available on the other platforms
Maybe there's a bit more to it, not sure
129 Views