Home / IOS Development / fast – Trying to build the open source iOS app and connect to my own server

fast – Trying to build the open source iOS app and connect to my own server

I’m trying to build the Signal iOS app to connect to my own Signal server.

I have already built the Android app Signal to connect to my own server.

For both, I followed the article, https://github.com/madeindra/setup-guide/tree/master/signal-ios

Using Signal iOS build 3.1

3.2.6 XCode 12

I managed to get the app to build in XCode after some effort. The app ran, came through the verify phone number screen (so I guess was able to hit our server and I got the SMS through Twilio) Next was the User Info screen asking for name, this crashed with this error,

**Fatal error: [OWSUploadV2.swift:78 upload(data:uploadForm:uploadUrlPath:progressBlock:)]: Error: Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLStringKey=https://xxx.cloudfront.net/, NSErrorFailingURLKey=https://xxx.cloudfront.net/, _NSURLErrorRelatedURLSessionTaskErrorKey=(**
**"LocalUploadTask <2455BE4E-077E-4FD5-B8FA-7F03FD733F70>.<1>"**
**), _NSURLErrorFailingURLSessionTaskErrorKey=LocalUploadTask <2455BE4E-077E-4FD5-B8FA-7F03FD733F70>.<1>, NSLocalizedDescription=cancelled}: file SignalCoreKit/OWSSwiftUtils.swift, line 35**

This appeared to be a sort of SSL issue, although it had no issues opening the cloud front URL in a browser or in the Android app.

I added the code in OWSUploadV2.swift,

class func upload(data: Data,... {
        var uploadSessionManager = self.uploadSessionManager
        let securityPolicy = AFSecurityPolicy(pinningMode: AFSSLPinningMode.none)
            securityPolicy.validatesDomainName = false
            securityPolicy.allowInvalidCertificates = true
        uploadSessionManager.securityPolicy = securityPolicy

and this seemed to solve the problem but not sure why the problem occurred …

so this gets me to the next screen to enter a PIN, but this crashed with the error,

**2020-10-08 14:22:10:284 Signal[4202:2191958]** 💛 **[OWSWebSocket.m:605 -[OWSWebSocket processWebSocketResponseMessageAsync:]]: received WebSocket response requestId: 7765599138296075969, status: 200**
**2020-10-08 14:22:10:287 Signal[4202:2191848]** ❤️ **[VersionedProfilesImpl.swift:234 didFetchProfile(profile:profileRequest:)]: Invalid credential: VerificationFailed.**
**Fatal error: [VersionedProfilesImpl.swift:234 didFetchProfile(profile:profileRequest:)]: Invalid credential: VerificationFailed.: file SignalCoreKit/OWSSwiftUtils.swift, line 35**

This is where I’m stuck. Anyone have any ideas? Has anyone else got Signal iOS to connect to their own server?

Source link