SL-12421 Viewer's certificate validation does not reject connections

master
Andrey Kleshchev 2020-03-04 17:39:22 +02:00
parent 85f6feb14a
commit 82e5f6c24f
2 changed files with 7 additions and 7 deletions

View File

@ -1010,8 +1010,8 @@ CURLcode HttpOpRequest::curlSslCtxCallback(CURL *curl, void *sslctx, void *userd
if (op->mCallbackSSLVerify)
{
SSL_CTX * ctx = (SSL_CTX *)sslctx;
// disable any default verification for server certs
SSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, NULL);
// verification for ssl certs
SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, NULL);
// set the verification callback.
SSL_CTX_set_cert_verify_callback(ctx, sslCertVerifyCallback, userdata);
// the calls are void

View File

@ -240,16 +240,16 @@ void LLXMLRPCTransaction::Handler::onCompleted(LLCore::HttpHandle handle,
if (!status)
{
mImpl->setHttpStatus(status);
LLSD errordata = status.getErrorData();
mImpl->mErrorCertData = errordata;
if ((status.toULong() != CURLE_SSL_PEER_CERTIFICATE) &&
(status.toULong() != CURLE_SSL_CACERT))
{
// if we have a curl error that's not already been handled
// (a non cert error), then generate the error message as
// (a non cert error), then generate the warning message as
// appropriate
mImpl->setHttpStatus(status);
LLSD errordata = status.getErrorData();
mImpl->mErrorCertData = errordata;
LL_WARNS() << "LLXMLRPCTransaction error "
<< status.toHex() << ": " << status.toString() << LL_ENDL;
LL_WARNS() << "LLXMLRPCTransaction request URI: "