https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
h

Hamza Ahmad

09/30/2021, 7:57 AM
Hello everyone, i'm working in KMM and use ktor library for 'http calls' , but when called server request I got exception and it says "Exception in http request: Error Domain = NSURlErrorDomain Code = -1202 'The certificate for this server is invalid.'" and ktor only calls request that have url with https is there any solution to call server request with simple http instead of https?
j

John O'Reilly

09/30/2021, 8:11 AM
"ktor only calls request that have url with https" Ktor can make requests to http endpoints. What you may need to do though is configure your iOS/Android projects (if that's what you're using) to allow such requests....but that's a general requirement, independent of use of Ktor.
for example on Android you may need to have following in your
AndroidManfiest.xml
Copy code
android:usesCleartextTraffic="true"
h

Hamza Ahmad

09/30/2021, 8:24 AM
and for ios what should we write?
27 Views