ios - 尝试构建开源 Signal iOS 应用程序并连接到我自己的服务器

标签 ios swift xcode

我正在尝试构建 Signal iOS 应用程序以连接到我自己的 Signal 服务器。
我已经成功构建了 Signal Android 应用程序以连接到我自己的服务器。
对于我遵循的文章,
https://github.com/madeindra/setup-guide/tree/master/signal-ios
使用 Signal iOS 版本 3.13.2.6
代码 12
经过一番努力,我能够在 XCode 中构建应用程序。
该应用程序运行,通过验证电话号码屏幕(所以我假设能够成功访问我们的服务器并且我通过 Twilio 收到了 SMS 消息)
接下来是用户信息屏幕询问姓名,此错误导致崩溃,

**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**
这似乎是某种 SSL 问题,尽管在浏览器或 Android 应用程序中打开 cloudfront URL 没有任何问题。
我将代码添加到 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
这似乎解决了问题,但不确定为什么会出现问题......
所以这让我进入下一个输入 PIN 的屏幕,但这因错误而崩溃,
**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**
这就是我被困的地方。谁有想法?
有没有其他人成功地让 Signal iOS 连接到他们自己的服务器?
*** 更多信息
所以这个错误发生在 VersionedProfilesImpl.swift didFetchProfile() 的第 234 行
in receiveProfileKeyCredential()

let credentialResponse = try ProfileKeyCredentialResponse(contents: UInt8)
let clientZkProfileOperations = try self.clientZkProfileOperations()
let profileKeyCredential = try clientZkProfileOperations.receiveProfileKeyCredential(profileKeyCredentialRequestContext: requestContext, profileKeyCredentialResponse: credentialResponse)
在我看到的服务器日志中,
127.0.0.1 - - [16/Oct/2020:14:40:50 +0000] “GET /v1/accounts/apn/preauth/3d80bda824920abd18b41aee5bb2559e01545705d52e7e00da49f3a43a745d96/+16137966017 HTTP/1.1” 200 0 “-” “Signal/3.13.2 (iPhone; iOS 13.7; Scale/2.00)” 9
127.0.0.1 - - [16/Oct/2020:14:40:50 +0000] “GET /v1/accounts/sms/code/+16137966017?client=ios HTTP/1.1” 200 0 “-” “Signal/3.13.2 (iPhone; iOS 13.7; Scale/2.00)” 11
127.0.0.1 - - [16/Oct/2020:14:41:21 +0000] “PUT /v1/accounts/code/443388?transfer=true HTTP/1.1” 200 70 “-” “Signal/3.13.2 (iPhone; iOS 13.7; Scale/2.00)” 153
127.0.0.1 - - [16/Oct/2020:14:41:21 +0000] “PUT /v1/accounts/attributes/ HTTP/1.1” 204 0 “-” “Signal/3.13.2 (iPhone; iOS 13.7; Scale/2.00)” 96
127.0.0.1 - - [16/Oct/2020:14:41:21 +0000] “PUT /v2/keys HTTP/1.1” 204 0 “-” “Signal/3.13.2 (iPhone; iOS 13.7; Scale/2.00)” 24
127.0.0.1 - - [16/Oct/2020:14:41:22 +0000] “PUT /v1/accounts/apn HTTP/1.1” 204 0 “-” “Signal/3.13.2 (iPhone; iOS 13.7; Scale/2.00)” 111
127.0.0.1 - - [16/Oct/2020:14:41:22 +0000] “GET /v1/profile/1337589b-38e8-4d09-9ae1-0c362b94ef42/af9e332d7ad279230a009d6ceb08928ce016207edd535d9fcfd5b1a34c76b9e1/0092959035165afc50b3e02c63520618462daec7f9fbe0a33a0fa2a4b5f84b5e4e78a149606a4b2b3e3221dc266093d337bf2cbbd38029bfc0d8d608a4e3945a02f83663dcb4a504c717f63bcdbf89cc86a22aaaa88b15d792fd0a9c6328eb1a475ab4612763ec95b77cf3227bd07b601f9a5b3e3b976987b2d14282227e33dc5b1695eadb513c99c047bb0f5568265d9279b21dc49c9acf7de0f6393fd1230d56a0000000000000007fad1caa1ea858ce6ca91e4db5ab60e2d4b5dba0d561ca1f8da2bbdbefed7c0ed1d630313e05e474b42c95cb6fe42ea38e27a13510ab99170b147372f4270200fc41ae958ed04c10b3fb182f34bb7d27ab030df1ee2aa01bb3da848a6fb14a0e3bc5e1583dadaefa66d3b9232e9ac0f33cc651b7ac01e21320d3d413041ffb091a3756f0eda2cf8ec4d0a2280bffbb40741db358ad4d29ef3be1542aeb59ad0a HTTP/1.1” 200 281 “-” “Signal/3.13.2 (iPhone; iOS 13.7; Scale/2.00)” 110
127.0.0.1 - - [16/Oct/2020:14:41:22 +0000] “GET /v1/config/ HTTP/1.1” 200 13 “-” “Signal/3.13.2 (iPhone; iOS 13.7; Scale/2.00)” 140
127.0.0.1 - - [16/Oct/2020:14:41:22 +0000] “GET /v1/websocket/?login=1337589B-38E8-4D09-9AE1-0C362B94EF42&password=0f9a8ed6a5909226b76f520fe7181447 HTTP/1.1” 101 0 “-” “-” 6
127.0.0.1 - - [16/Oct/2020:14:41:22 +0000] “GET /v1/certificate/delivery?includeUuid=true HTTP/1.1” 200 386 “-” “Signal/3.13.2 (iPhone; iOS 13.7; Scale/2.00)” 2
127.0.0.1 - - [16/Oct/2020:14:41:22 +0000] “PUT /v1/directory/tokens HTTP/1.1” 200 173 “-” “Signal/3.13.2 (iPhone; iOS 13.7; Scale/2.00)” 9
127.0.0.1 - - [16/Oct/2020:14:41:22 +0000] “GET /v2/attachments/form/upload HTTP/1.1” 200 908 “-” “Signal/3.13.2 (iPhone; iOS 13.7; Scale/2.00)” 117
174.112.230.123 - - [16/Oct/2020:14:41:23 +0000] “GET /v2/attachments/form/upload WS” 200 911 “-” “-”
127.0.0.1 - - [16/Oct/2020:14:41:23 +0000] “GET /v1/certificate/delivery?includeUuid=true HTTP/1.1” 200 386 “-” “Signal/3.13.2 (iPhone; iOS 13.7; Scale/2.00)” 3
174.112.230.123 - - [16/Oct/2020:14:41:23 +0000] “PUT /v1/messages/1337589B-38E8-4D09-9AE1-0C362B94EF42 WS” 200 19 “-” “-”
174.112.230.123 - - [16/Oct/2020:14:41:23 +0000] “GET /v2/attachments/form/upload WS” 200 911 “-” “-”
127.0.0.1 - - [16/Oct/2020:14:41:23 +0000] “GET /v1/certificate/delivery?includeUuid=true HTTP/1.1” 200 386 “-” “Signal/3.13.2 (iPhone; iOS 13.7; Scale/2.00)” 9
127.0.0.1 - - [16/Oct/2020:14:41:24 +0000] “GET /v1/certificate/delivery?includeUuid=true HTTP/1.1” 200 386 “-” “Signal/3.13.2 (iPhone; iOS 13.7; Scale/2.00)” 3
174.112.230.123 - - [16/Oct/2020:14:41:30 +0000] “GET /v2/attachments/form/upload WS” 200 911 “-” “-”
127.0.0.1 - - [16/Oct/2020:14:41:30 +0000] “PUT /v1/profile/ HTTP/1.1” 200 0 “-” “Signal/3.13.2 (iPhone; iOS 13.7; Scale/2.00)” 123
127.0.0.1 - - [16/Oct/2020:14:41:30 +0000] “GET /v1/certificate/delivery?includeUuid=true HTTP/1.1” 200 386 “-” “Signal/3.13.2 (iPhone; iOS 13.7; Scale/2.00)” 6
174.112.230.123 - - [16/Oct/2020:14:41:30 +0000] “GET /v1/profile/1337589b-38e8-4d09-9ae1-0c362b94ef42/af9e332d7ad279230a009d6ceb08928ce016207edd535d9fcfd5b1a34c76b9e1/00bc7024e8593f2ca3665200bc3c71dee84f3524d883fd22edbddc6559efa13618ac2a3736c8086c1aa1bf5751eee2f888889fffc6e1c69f780cc8f3c17a6c1e11dc7f701c382d730165315b30030135fe3f7ff3a3ef8130415ce32af84961022a02f28cea455dd5ab797d27a1387e84c8a9ef67e9f8e643d403f070953402941ea0476ff62c5c035790b6498859327a70700655658cc0c219dcd2e28c2561ac25a000000000000000ed8bc9223598e010648d19f3d3687763ab922475a3359056df73fa88f0652901213e131a46dd57be49160d2b303b724d579d1dabc51f01acb74e2e8976a1d4053787f9c02d5f37535e8fdc0cec7a06fda935f679a479b13bb6e4eb37923ded00bf9dadf786813b400dbad61886132030d881c99860392ddafc33c5bd85bd4f0b4e0165418bb91896a73c726624ee6759c732543d6287ec7162d781532dde1200 WS” 200 997 “-” “-”
知道可能是什么原因吗?
我可以使用相同的设置从 Android 连接到同一台服务器。

最佳答案

似乎将某些内容上传到 aws cloudfront 时出现问题。它给你一个 -999 错误。 -999 错误是这样的:

-999 is caused by ErrorCancelled. This means: another request is made before the previous request is completed.


程序是否在将配置文件详细信息上传到服务器之前发出请求?

关于ios - 尝试构建开源 Signal iOS 应用程序并连接到我自己的服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64268915/

相关文章:

ios - SwiftUI - 预览时未知的预览提供程序 "ContentView_Previews_"。发生在一个全新的项目中

ios - 在 Swift 中更改导航栏中的字体

swift - 如何在应用程序页面中使用预览制作网页 View ?

ios - 如何将键及其值添加到字典中?

ios - 如何在 Swift 中将 PNG 转换为 WebP?

c# - ExternalAccessory 输入流/输出流为空?

ios - 更改 UITextView 字体大小

objective-c - 更新媒体收集队列 MPMediaItemCollection 时短暂停止/开始“正在播放”项目

xcode - geocoder.geocodeAddressString 今天不再适用于快速更新

iphone - 如何在实现文件中运行一个函数?