Hi Matt,
What I do not understand yet is that running on watchOS 6 the code runs OK and connects to the server. If I do it under whatchOS 7 beta it gives me the following error:
PDTask <C109A177-0F66-4F87-876E-F5C104CC47BD>.<1> finished with error [-1200] Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={NSErrorClientCertificateStateKey=0, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataPDTask <C109A177-0F66-4F87-876E-F5C104CC47BD>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=("LocalDataPDTask <C109A177-0F66-4F87-876E-F5C104CC47BD>.<1>",
"LocalDataTask <C109A177-0F66-4F87-876E-F5C104CC47BD>.<1>"), NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9802}
What my code does is to save locally in the "fingerprints" array the "Fingerprint SHA256" of the server certificate and at runtime, obtain the server certificate, generate the SHA256 fingerprint and compare it to what I have saved on that variable. And it works OK.
What I would also like to know if there is a need to put some kind of key in a .plist or something... If you discover that something need to be put there I would appreciate. I will follow your advice and continue my tests and wait for the final release. If I discover something or your discover something, please lets use this thread. Thank you again so much for your kind support.
Best Regards, Marcus.
Topic:
App & System Services
SubTopic:
Core OS
Tags: