xamarin / Xamarin.Auth

Xamarin.Auth
Apache License 2.0
541 stars 351 forks source link

iOS 9 exception: Error Domain=NSURLErrorDomain Code=-1200 #347

Closed lewixlabs closed 4 years ago

lewixlabs commented 5 years ago

Xamarin.Auth Issue (iOS v9 only)

Version

Platform:

Demo Project which demostrates this issue

https://github.com/lewixlabs/OAuth2Forms client_id, client_secret are omitted for security reasons, contact me if you need to test

Expected behaviour

OAuth2 authentication completed with valid access_token returned

Actual behaviour

In webview i insert correct credentials, but after doing this, with iOS 9 only, authenticator raises error event with this stack trace:

Error Domain=NSURLErrorDomain Code=-1200 \"An SSL error has occurred and a secure connection to the server cannot be made.\" UserInfo={NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorCodeKey=-9806, NSErrorFailingURLStringKey=https://oauthidp.polimi.it/oauthidp/oauth2/token, _kCFStreamErrorDomainKey=3, NSUnderlyingError=0x17481700 {Error Domain=kCFErrorDomainCFNetwork Code=-1200 \"(null)\" UserInfo={_kCFNetworkCFStreamSSLErrorOriginalValue=-9806, _kCFStreamErrorCodeKey=-9806, _kCFStreamErrorDomainKey=3, _kCFStreamPropertySSLClientCertificateState=0}}, NSErrorFailingURLKey=https://oauthidp.polimi.it/oauthidp/oauth2/token}

Anyone can suggest me:

As HttpClient, on iOS side, i tried all options without luck (everytime rebuilding project and deleting obj/bin folders)

Thank you for any suggestion/help, if you need more infos let me know.

Lewix

VS bug #738679, VS bug #1042002

lewixlabs commented 5 years ago

Of course i also tried setting

    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
    </dict>

but without success

newky2k commented 5 years ago

@lewixlabs Could you please provide a small sample which demonstrates this problem, so that we can investigate.

Regards

lewixlabs commented 5 years ago

@lewixlabs Could you please provide a small sample which demonstrates this problem, so that we can investigate.

Regards

Hi @newky2k , i updated issue description adding demo test link. Please contact me (lewixlabs a t gmail d o t com) you or your team to get complete credentials to test the demo project.

Thank you! Lewix

moljac commented 5 years ago

I need to take a look, but this will be a problem because of older OS version.

Triaged as "Low priority"

lewixlabs commented 5 years ago

Hi @moljac, thanks for your feedback. Yes i know it's an older version of iOS, infact in my company we have only one iPhone 5 with iOS 9 which we don't update just to test these cases.

Let me know (lewixlabs AT gmail DOT com) if you need OAuth2 credentials to test it.

Hi, Lewix

moljac commented 5 years ago

triaging it as "Low Priority"

In order to speed up the bugfixing, please add link to the repo with minimal sample (with removed sensitve data)

lewixlabs commented 5 years ago

Yes i already added, please check details on my first post Et voilà :) https://github.com/lewixlabs/OAuth2Forms

Let me know when you/your team will need sensitive OAuth2 params. Thank you

lewixlabs commented 5 years ago

Hi, i know this issue has a low priority, this post only to know if you need oauth2 credentials to test with my demo project https://github.com/lewixlabs/OAuth2Forms

Thanks

lewixlabs commented 4 years ago

I close this issue (low priority/no response from oauth team and months ago I updated my app compatible from iOS 10 only.