gpt4 book ai didi

c# - 如何忽略 ssl_client_socket_impl.cc(1061)] 在 selenium c# ChromeDriver 中握手失败

转载 作者:太空宇宙 更新时间:2023-11-03 14:47:02 26 4
gpt4 key购买 nike

我已经添加了

 ChromeOptions options = new ChromeOptions();
options.AddArgument("--ignore-certificate-errors-spki-list");
options.AddArgument("--ignore-ssl-errors");
options.AddArgument("test-type");
options.AddArguments("-incognito");
options.AddArgument("no-sandbox");
options.AddArgument("--start-maximized");
driver = new ChromeDriver(options);

但仍然得到:

ssl_client_socket_impl.cc(1061)] handshake failed error 

如何从控制台抑制这个错误?

enter image description here

最佳答案

这个错误信息...

[ERROR:ssl_client_socket_openssl.cc(855)] handshake failed; returned -1, SSL error code 1, net_error -2

...意味着 ChromeDriverChrome 浏览器 之间的握手失败在某个时候失败了。


根本原因

此错误是由于 net::SSLClientSocketImpl::DoHandshake 产生的和 net::SSLClientSocketImplssl_client_socket_impl.ccnet::SSLClientSocketImpl::DoHandshake 中实现如下:

int SSLClientSocketImpl::DoHandshake() {
crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE);
int rv = SSL_do_handshake(ssl_.get());
int net_error = OK;
if (rv <= 0) {
int ssl_error = SSL_get_error(ssl_.get(), rv);
if (ssl_error == SSL_ERROR_WANT_CHANNEL_ID_LOOKUP) {
// The server supports channel ID. Stop to look one up before returning to
// the handshake.
next_handshake_state_ = STATE_CHANNEL_ID_LOOKUP;
return OK;
}
if (ssl_error == SSL_ERROR_WANT_X509_LOOKUP &&
!ssl_config_.send_client_cert) {
return ERR_SSL_CLIENT_AUTH_CERT_NEEDED;
}
if (ssl_error == SSL_ERROR_WANT_PRIVATE_KEY_OPERATION) {
DCHECK(ssl_config_.client_private_key);
DCHECK_NE(kSSLClientSocketNoPendingResult, signature_result_);
next_handshake_state_ = STATE_HANDSHAKE;
return ERR_IO_PENDING;
}
OpenSSLErrorInfo error_info;
net_error = MapLastOpenSSLError(ssl_error, err_tracer, &error_info);
if (net_error == ERR_IO_PENDING) {
// If not done, stay in this state
next_handshake_state_ = STATE_HANDSHAKE;
return ERR_IO_PENDING;
}
LOG(ERROR) << "handshake failed; returned " << rv << ", SSL error code "
<< ssl_error << ", net_error " << net_error;
net_log_.AddEvent(
NetLogEventType::SSL_HANDSHAKE_ERROR,
CreateNetLogOpenSSLErrorCallback(net_error, ssl_error, error_info));
}
next_handshake_state_ = STATE_HANDSHAKE_COMPLETE;
return net_error;
}

根据 ERROR:ssl_client_socket_openssl.cc handshake failed主要问题是 ChromeDriverChrome 中的 SSL 页面 握手时握手 失败>。尽管 Chromium 团队通过 net_unittestscontent_testsbrowser_testsSSL 握手 进行了测试但并不详尽。一些用例依赖于上游测试而被排除在外。

结论

此错误不会中断您的测试套件执行,您可以暂时忽略此问题,直到它被修复由 Chromium 团队

关于c# - 如何忽略 ssl_client_socket_impl.cc(1061)] 在 selenium c# ChromeDriver 中握手失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53735756/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com