FatFractal customer forums



Author Topic: Connecting Locally through XCode  (Read 784 times)

Rich

  • Newbie
  • *
  • Posts: 1
    • View Profile
Connecting Locally through XCode
« on: September 24, 2015, 09:14:38 PM »
We have been able to setup a local install of FatFractal and connect through the databrowser, we also have our iOS app connecting and running with our backend in the cloud.

However, we were wondering if there is anything special that needs to be done to connect to the local fatfractal install through XCode to run the iOS app.

We have our connection strings as:

static NSString *baseUrl = @"http://localhost:8080/<appName>";
static NSString *sslUrl = @"https://localhost:8443/<appName>";

We've tried adding:

[FFHttpDelegate addTrustedHost:@"localhost:8443/<appName>"];
[FFHttpDelegate addTrustedHost:@"localhost:8080/<appName>"];

And we get SSL errors when trying to login:

2015-09-24 19:57:59.644 Wryvals[9701:890404] Started (from main thread <NSThread: 0x7fc21d2012c0>{number = 1, name = main}) NSURLConnection for POST to https://localhost:8443/wyvalsAlpha/ff/login
2015-09-24 19:57:59.735 Wryvals[9701:890404] canAuthenticateAgainstProtectionSpace <NSURLProtectionSpace: 0x7fc21ae06f20>: Host:localhost, Server:https, Auth-Scheme:NSURLAuthenticationMethodServerTrust, Realm:(null), Port:8443, Proxy:NO, Proxy-Type:(null) called
2015-09-24 19:57:59.735 Wryvals[9701:890404] didReceiveAuthenticationChallenge <NSURLAuthenticationChallenge: 0x7fc21ae06f20> called
2015-09-24 19:57:59.735 Wryvals[9701:890404]          Challenge.protectionSpace.host == localhost
2015-09-24 19:57:59.735 Wryvals[9701:890404]          Host is a trusted host
2015-09-24 19:57:59.738 Wryvals[9701:890500] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)
2015-09-24 19:57:59.740 Wryvals[9701:890404] FFHttpDelegate calling onComplete for POST to https://localhost:8443/wyvalsAlpha/ff/login from main thread <NSThread: 0x7fc21d2012c0>{number = 1, name = main}
2015-09-24 19:57:59.741 Wryvals[9701:890404] HTTP POST failed: An SSL error has occurred and a secure connection to the server cannot be made. : statusCode 0
2015-09-24 19:57:59.742 Wryvals[9701:890404] Login failed: An SSL error has occurred and a secure connection to the server cannot be made.
2015-09-24 19:57:59.743 Wryvals[9701:890404] LoginWithUserName:(Passjjs) andPassword(Richard2) failed with error:(Error Domain=FatFractal Code=0 "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.}).
2015-09-24 19:57:59.812 Wryvals[9701:890404] Login failed

Is there any way to disable the need to login through SSL?

gkc

  • Administrator
  • *****
  • Posts: 375
    • View Profile
Re: Connecting Locally through XCode
« Reply #1 on: October 04, 2015, 09:36:28 AM »
Hi there,

When testing against localhost, you will need to include this in the app's Info.plist

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

NB: This should not be in the Info.plist when submitting to App Store

 

Copyright © FatFractal customer forums