SSL_ERROR_SSL(1):库中的操作失败 [英] SSL_ERROR_SSL(1): operation failed within the library

查看:9815
本文介绍了SSL_ERROR_SSL(1):库中的操作失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到一些 SSL错误 s(导致我的项目停止/挂起而没有崩溃,因为我有一个 DispatchGroup 等待请求),我不知道它们是如何造成的,它们是什么,或者该怎么办。



我读过关于此问题的大量页面粗略,但没有太多文档或人员遇到同样的问题。我试过



我可以看到我的代码当我向服务器发出请求时失败。 (这是我的框架)。如前所述,我有 DispatchGroup 等待此请求但代码停止。

  self.currentToken = try self.spotifyRequest(https://accounts.spotify.com/api/token,方法:。post,参数:参数)

我的请求方法:

  private func spotifyRequest(_ url:URLConvertible,方法:HTTPMethod,参数:参数?= nil,headers:HTTPHeaders?= nil)throws  - > JSONStandard {
//创建一个调度组来处理线程
let group = DispatchGroup()
group.enter()

//请求的状态(启动as nil)
var status:JSONStandard?


DispatchQueue.global(qos:.userInitiated).async {
Alamofire.request(url,method:method,parameters:parameters,headers:headers).responseJSON(completionHandler) :{$ in
//检查响应是否有效
如果让requestResponse = response.result.value为?JSONStandard {
status = requestResponse
} else {
status = nil
}

//让下一个任务完成,它已经等待请求
group.leave()
})
}


//等待结果
group.wait()

//返回值或抛出错误
如果let safeStatus = status {
return safeStatus
} else {
getAccessToken()
throw SpotifyError.failedToCompleteRequest
}
}

我不确定是什么导致了问题,因为我所做的只是稍微编辑并再次存档框架。



然而,之前它同时适用于两者(因为我正在使用



这是 Spotify 请求通过 Alamofire 之前曾有过工作,但现在神秘却没有。它无法在我的设备模拟器上运行。



这是一个与安全互联网连接有关的问题吗?或者这是另一个问题吗?



我看到的一些链接:





编辑:



这是Spotify服务器上的问题吗?或Xcode 10中的错误?我将框架 .swift 文件移动到我的项目中,仍然可以获取日志。



我也遇到这些错误在我的要求之前,奇怪

I am getting some SSL Errors (which are causing my project to stop/hang with no crash as I have a DispatchGroup waiting for the request), which I don't know how they are caused, what they are, or what to do about it.

I have read numerous pages roughly about this problem, but there are not much documentation or people having the same problem. I have tried changing the info.plist but that doesn't seem to have helped. Both plist's look like this: (accounts.spotify.com is the domain for the URL of the access token request)

I can see that my code is failing when I make a request to the server. (This is in my framework). As mentioned earlier, I have a DispatchGroup waiting for this request but the code stops.

self.currentToken = try self.spotifyRequest("https://accounts.spotify.com/api/token", method: .post, parameters: parameters)

My request method:

private func spotifyRequest(_ url: URLConvertible, method: HTTPMethod, parameters: Parameters? = nil, headers: HTTPHeaders? = nil) throws -> JSONStandard {
    // Create a dispatch group to handle threads
    let group = DispatchGroup()
    group.enter()

    // Status of the request (starts as nil)
    var status: JSONStandard?


    DispatchQueue.global(qos: .userInitiated).async {
        Alamofire.request(url, method: method, parameters: parameters, headers: headers).responseJSON(completionHandler: { response in
            // Check if response is valid
            if let requestResponse = response.result.value as? JSONStandard {
                status = requestResponse
            } else {
                status = nil
            }

            // Let the next tasks be completed, it has finished waiting for the request
            group.leave()
        })
    }


    // Wait for a result
    group.wait()

    // Return value or throw an error
    if let safeStatus = status {
        return safeStatus
    } else {
        getAccessToken()
        throw SpotifyError.failedToCompleteRequest
    }
}

I'm not exactly sure what caused the problem, because all I did was slightly edit and archive the framework again.

However, earlier it worked on both (as I am using this universal framework script)

Here is my crash log (which I can't understand any of!):

2018-08-18 21:36:45.747984+0100 Songvote[4854:1517160] [BoringSSL] boringssl_session_errorlog(224) [C2.1:2][0x107d7c600] [boringssl_session_read] SSL_ERROR_SSL(1): operation failed within the library

2018-08-18 21:36:45.748123+0100 Songvote[4854:1517160] [BoringSSL] boringssl_session_handshake_error_print(205) [C2.1:2][0x107d7c600] 4427428040:error:100000d7:SSL routines:OPENSSL_internal:SSL_HANDSHAKE_FAILURE:/BuildRoot/Library/Caches/com.apple.xbs/Sources/boringssl/boringssl-109.200.32/ssl/ssl_lib.cc:1081:

2018-08-18 21:36:45.748238+0100 Songvote[4854:1517160] [BoringSSL] boringssl_session_errorlog(224) [C2.1:2][0x107d7c600] [boringssl_session_read] SSL_ERROR_SSL(1): operation failed within the library

2018-08-18 21:36:45.748432+0100 Songvote[4854:1517160] [BoringSSL] boringssl_session_handshake_error_print(205) [C2.1:2][0x107d7c600] 4427428040:error:100000d7:SSL routines:OPENSSL_internal:SSL_HANDSHAKE_FAILURE:/BuildRoot/Library/Caches/com.apple.xbs/Sources/boringssl/boringssl-109.200.32/ssl/ssl_lib.cc:1081:

2018-08-18 21:36:45.754554+0100 Songvote[4854:1517160] [BoringSSL] boringssl_session_errorlog(224) [C2.1:2][0x107d7c600] [boringssl_session_read] SSL_ERROR_SSL(1): operation failed within the library

2018-08-18 21:36:45.754640+0100 Songvote[4854:1517160] [BoringSSL] boringssl_session_handshake_error_print(205) [C2.1:2][0x107d7c600] 4427428040:error:100000d7:SSL routines:OPENSSL_internal:SSL_HANDSHAKE_FAILURE:/BuildRoot/Library/Caches/com.apple.xbs/Sources/boringssl/boringssl-109.200.32/ssl/ssl_lib.cc:1081:

2018-08-18 21:36:45.754717+0100 Songvote[4854:1517160] [BoringSSL] boringssl_session_errorlog(224) [C2.1:2][0x107d7c600] [boringssl_session_read] SSL_ERROR_SSL(1): operation failed within the library

2018-08-18 21:36:45.754796+0100 Songvote[4854:1517160] [BoringSSL] boringssl_session_handshake_error_print(205) [C2.1:2][0x107d7c600] 4427428040:error:100000d7:SSL routines:OPENSSL_internal:SSL_HANDSHAKE_FAILURE:/BuildRoot/Library/Caches/com.apple.xbs/Sources/boringssl/boringssl-109.200.32/ssl/ssl_lib.cc:1081:

2018-08-18 21:38:43.427156+0100 Songvote[4854:1517503] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C1.1:2][0x107e1b4c0] get output frames failed, state 8196

2018-08-18 21:38:43.427656+0100 Songvote[4854:1517503] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C1.1:2][0x107e1b4c0] get output frames failed, state 8196

2018-08-18 21:38:43.429723+0100 Songvote[4854:1517503] TIC Read Status [1:0x0]: 1:57

2018-08-18 21:38:43.429976+0100 Songvote[4854:1517503] TIC Read Status [1:0x0]: 1:57

2018-08-18 21:38:46.008365+0100 Songvote[4854:1517503] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C2.1:2][0x107d7c600] get output frames failed, state 8196

2018-08-18 21:38:46.008664+0100 Songvote[4854:1517503] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C2.1:2][0x107d7c600] get output frames failed, state 8196

2018-08-18 21:38:46.010037+0100 Songvote[4854:1517503] TIC Read Status [2:0x0]: 1:57

2018-08-18 21:38:46.010215+0100 Songvote[4854:1517503] TIC Read Status [2:0x0]: 1:57

This is all for a Spotify request through Alamofire which previously worked and now mysteriously doesn't. It does not work on my device OR the simulator.

Is this a problem relating to secure internet connections? Or is this another problem?

Some links to what I have looked at:

Edits:

Is this a problem on Spotify's servers? Or a bug in Xcode 10? I moved my framework .swift files to my project, and still get the logs.

I also get these errors before my request, strange

这篇关于SSL_ERROR_SSL(1):库中的操作失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆