0

I'm developing audio streaming app and I'm facing SSL Handshake issue now. I googled problem and already added this code in info.plist but no luck.

<key>NSAppTransportSecurity</key>
<dict>
    <!--Connect to anything (this is probably BAD)-->
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>

Can anyone please tell me solution who had this issue please?

Ioan Moldovan
  • 2,272
  • 2
  • 29
  • 54
  • If you have HTTPS connection you don't need the NSAppTransportSecurity since you are basically having a secure connection with SSL. Are you sure you are connecting to an HTTPS server? Is the server correct configured? https://www.ssllabs.com/ssltest/ If you are not connecting to a secure connection and only using HTTP, then you need to add the domain etc. to your NSAppTransportSecurity http://stackoverflow.com/questions/31254725/transport-security-has-blocked-a-cleartext-http However, if you can provide the exact error we can understand easier what the problem is maybe. –  Mar 02 '17 at 06:26
  • Hello, I'm playing audio from soundcloud and endpoint is api.soundcloud.com, and the error occured is "SSLHandshake failed " – Ioan Moldovan Mar 02 '17 at 15:29
  • it is popular server and I don't think there is issue with server. – Ioan Moldovan Mar 02 '17 at 15:29
  • I would guess that you are trying to access the api outside of the developer API allowed (?) , if so, then they are probably using ssl-pinning and you are not allowed. –  Mar 02 '17 at 16:18
  • well, url is https://api.soundcloud.com/tracks/308370346/stream/?client_id=86f16b1ab97d315eb7eabbaa8bb29364 and when i open in browser, it works fine, I don't think I used incorrect api. – Ioan Moldovan Mar 02 '17 at 16:46
  • It's either that you are blocked as I mentioned before calling it from your device. Or , it could also be that you are formatting your NSURL wrong, you should log the URL and see what it prints out in the console and if that URL is correct. –  Mar 03 '17 at 03:31

0 Answers0