我在使用WolfSSL时遇到了一些问题。我试图在WolfSSL论坛上提问,但现在注册无法正常工作。
我正在使用WolfSSL为Nintendo Wii开发一个简单的电子邮件客户端。 WolfSSL是唯一声称具有Wii兼容性的库。我已经用devKitPro成功构建了库,一切似乎都在工作,但握手失败了。
以下是一些示例代码:
bool Internet::sslSetup(){
if(wolfSSL_Init() != SSL_SUCCESS){
sslReportError();
return false;
}
setState("SSL Init");
method = wolfSSLv23_client_method();
if (method == NULL) {
sslReportError();
return false;
}
setState("SSL Method Set");
ctx = wolfSSL_CTX_new(method);
wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0);
if(ctx == NULL){
sslReportError();
return false;
}
setState("SSL Ctx Init");
sslSocket = wolfSSL_new(ctx);
if(sslSocket == NULL){
sslReportError();
return false;
}
setState("SSL Socket Init");
wolfSSL_set_fd(sslSocket, socket);
if(sslSocket == NULL){
sslReportError();
return false;
}
setState("SSL Socket connected to net socket");
return true;
}
我没有办法在Wii上进行调试,所以我将降级为文本调试。这是我的WolfSSL调试输出日志:
13 05 2016 00:55 wolfSSL Entering wolfSSL_Init
13 05 2016 00:55 wolfSSL Entering WOLFSSL_CTX_new
13 05 2016 00:55 wolfSSL Entering wolfSSL_CertManagerNew
13 05 2016 00:55 wolfSSL Leaving WOLFSSL_CTX_new, return 0
13 05 2016 00:55 wolfSSL Entering wolfSSL_CTX_set_verify
13 05 2016 00:55 wolfSSL Entering SSL_new
13 05 2016 00:55 wolfSSL Leaving SSL_new, return 0
13 05 2016 00:55 wolfSSL Entering SSL_set_fd
13 05 2016 00:55 wolfSSL Leaving SSL_set_fd, return 1
13 05 2016 00:55 wolfSSL Entering SSL_connect()
13 05 2016 00:55 growing output buffer
13 05 2016 00:55 Shrinking output buffer
13 05 2016 00:55 connect state: CLIENT_HELLO_SENT
13 05 2016 00:55 received record layer msg
13 05 2016 00:55 got ALERT!
13 05 2016 00:55 Got alert
13 05 2016 00:55 wolfSSL error occurred, error = 40
13 05 2016 00:55 wolfSSL error occurred, error = -313
有什么想法吗?尝试连接到端口465上的smtp.gmail.com。
答案 0 :(得分:2)
它看起来像是TLS握手错误,因为:
接下来的步骤是: