Open loinsir opened 2 years ago
Facing the same issue :(
To @gordonbeijing .
Finally, I solved this issue.
You should implement URLSessionDelegate
in EONET.swift like this:
extension EONET: URLSessionDelegate {
func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
//accept all certs when testing, perform default handling otherwise
completionHandler(.useCredential, URLCredential(trust: challenge.protectionSpace.serverTrust!))
}
}
and you should create your URLSession request like this:
return URLSession(configuration: .ephemeral,
delegate: EONET(), delegateQueue: nil).rx.response(request: request)
I hope you can solve this problem smoothly. :)
To @loinsir .
Thanks a lot ! It works well.
At first it didn't work after I modifying the codes according to your solution. I checked the error message, it was not the same as before. So I doubt it may be caused by some mysterious strength , and after I enabling the proxy, it works as expected 🥳
Anyway, thanks again!
In Chapter 10, net.sci.gsfc.nasa.gov api has a ssl problem.