1
こんにちは私はHttps RequestをSwiftで作成したいと思います。現在、私はIPアドレスでローカルサーバーにアクセスしています。ローカルサーバーは、証明書にアクセスすることによって1つのSSL証明書を持っています。Swift:サーバーSSL証明書を使用してHttpsリクエストを作成する方法
Alamofire.request(.GET, https://ipaddress//, parameters: [param], headers: headers)
.responseJSON { response in
print(response.request) // original URL request
print(response.response) // URL response
print(response.data) // server data
print(response.result) // result of response serialization
if let JSON = response.result.value {
print("JSON: \(JSON)")
}
}
は私がこのように与えられてきたが、イムはまだ
のようなエラーを取得要求を行うためとのplist plistの中<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>192.168.2.223:1021(my local ip)</key>
<dict>
Include to allow subdomains-->
<key>NSIncludesSubdomains</key>
<true/>
<!--Include to allow insecure HTTP requests-->
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<!--Include to specify minimum TLS version-->
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
</dict>
</dict>
</dict>
に上記のコードを使用している
NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)
IPアドレスをATS plist値で使用することはできません。 –
解決策はありましたか? –