Forum Xamarin Xamarin.Forms

SSL issue after updating to Version 16.7.6

Hi
Sorry to ask the question here but it was the Xamarin update that broke it so hopeful will help others if any one knows the solution
So app works on Android UWP and Apple have recently updated to version 16.7.6 and now my iPhone gives SSL errors when connecting to server
I have double check on an older version on my other laptop and all works fine, shame I cant uninstall 16.7.6 as I would :( wondered if anyone knows the issue or solution on reading as of the first of September looks like Apple doesn't support ssl that is alive greater than 6 months but mine is only 3 months, I have reapplied for a new certificate but this didn't fix the issue the error I get is

2020-10-13 22:00:03.378594-0700 MyApp.iOS[15050:605866] ATS failed system trust
2020-10-13 22:00:03.378922-0700 MyApp.iOS[15050:605866] Connection 1: system TLS Trust evaluation failed(-9802)
2020-10-13 22:00:03.379122-0700 MyApp.iOS[15050:605866] Connection 1: TLS Trust encountered error 3:-9802
2020-10-13 22:00:03.379378-0700 MyApp.iOS[15050:605866] Connection 1: encountered error(3:-9802)
2020-10-13 22:00:03.386005-0700 MyApp.iOS[15050:605866] Task <0F8C1A53-C662-4B8D-879F>.<1> HTTP load failed, 0/0 bytes (error code: -1200 [3:-9802])
2020-10-13 22:00:03.389954-0700 MyApp.iOS[15050:605866] Task <0F8C1A53-C662-4B8D-879>.<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={NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorDomainKey=3, NSErrorPeerCertificateChainKey=(
"<cert(0x7fa292e) s: MyApp.com i: Let's Encrypt Authority X3>",
"<cert(0x7fa293a) s: Let's Encrypt Authority X3 i: DST Root CA X3>"
), NSErrorClientCertificateStateKey=0, NSErrorFailingURLKey=https://MyApp.com/bob/login2.php, NSErrorFailingURLStringKey=https://MyApp.com/bob/login2.php, NSUnderlyingError=0x60000103cfc0 {Error Domain=kCFErrorDomainCFNetwork Code=-1200 "(null)" UserInfo={_kCFStreamPropertySSLClientCertificateState=0, kCFStreamPropertySSLPeerTrust=, _kCFNetworkCFStreamSSLErrorOriginalValue=-9802, _kCFStreamErrorDomain
Key=3, _kCFStreamErrorCodeKey=-9802, kCFStreamPropertySSLPeerCertificates=(
"<cert(0x7fa292eba800) s: MyApp.com i: Let's Encrypt Authority X3>",
"<cert(0x7fa293aaf600) s: Let's Encrypt Authority X3 i: DST Root CA X3>"
)}}, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <0F8C1A53-C662-4B8D-879F>.<1>"
), _kCFStreamErrorCodeKey=-9802, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <0F8C1A53-C662-4B8D-879F-4B584AE81171>.<1>, NSURLErrorFailingURLPeerTrustErrorKey=, NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made.}

Best Answer

  • Jason1975Jason1975 Member ✭✭
    Accepted Answer

    OK so deleting XCode and reinstalling it fixed my SSL issue, Just would like to apologise to the Xamarin team for blaming there update and say thanks to Jarvan for pushing me to find the answer, many thanks just a shame it took me 48 hours and many SSL forum pages to finally fix but I suppose if you have an issue that no one else has then just uninstall and reinstall :)

Answers

  • JarvanJarvan Member, Xamarin Team Xamurai
    edited October 16

    An SSL error has occurred and a secure connection to the server cannot be made.

    What's the configuration of the info.plist? Try using the following code:

    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSExceptionDomains</key>
        <dict>
            <key>yourdomain.com</key>
            <dict>
                <!--Include to allow subdomains-->
                <key>NSIncludesSubdomains</key>
                <true/>
                <!--Include to allow HTTP requests-->
                <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
                <true/>
                <!--Include to specify minimum TLS version-->
                <key>NSTemporaryExceptionMinimumTLSVersion</key>
                <string>TLSv1.1</string>
            </dict>
        </dict>
    </dict>
    

    Similar issue:
    https://forums.xamarin.com/discussion/149778/system-net-webexception-an-ssl-error-has-occurred-and-a-secure-connection-to-the-server

  • Jason1975Jason1975 Member ✭✭

    thanks for trying Jarvan but I also did see that post but both solution that they mention do still just give me the same error :( Do you know if I uninstall visual studio and reinstall weather or not it comes with the latest update or not as im thinking of trying it. Not the best solution but I can afford to forget about the update and continue without it

  • JarvanJarvan Member, Xamarin Team Xamurai
  • Jason1975Jason1975 Member ✭✭

    Thanks Jarvan but looks like as im community edition im going to have to find the fix for the SSL as they don't allow you to down grade community editions that I can see :(

  • Jason1975Jason1975 Member ✭✭

    So I downgraded me windows VS by installing the pro version but this still didn't work but then this forced the mac to downgrade its version which after a restart seems to have fixed the issue for now which means I can now make my how to video and try to upload all versions to the various stores will have to come back to this issue later thanks interestingly im back using the vs community edition 16.7.6 and all is fine its just the version on the mac that is causing the ssl issue im just glad its not my ubuntu server

  • Jason1975Jason1975 Member ✭✭
    Accepted Answer

    OK so deleting XCode and reinstalling it fixed my SSL issue, Just would like to apologise to the Xamarin team for blaming there update and say thanks to Jarvan for pushing me to find the answer, many thanks just a shame it took me 48 hours and many SSL forum pages to finally fix but I suppose if you have an issue that no one else has then just uninstall and reinstall :)

Sign In or Register to comment.