Skip to content

Commit af8709f

Browse files
Ben Murdochandi34
authored andcommitted
Add client-side support for TLS_FALLBACK_SCSV
Change-Id: Iec479de2549fbbc1e1587663cbe1ff4795176ff2
1 parent 76d1172 commit af8709f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

net/socket/ssl_client_socket_openssl.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ int MapOpenSSLErrorSSL() {
181181
case SSL_R_TLSV1_ALERT_RECORD_OVERFLOW:
182182
case SSL_R_TLSV1_ALERT_USER_CANCELLED:
183183
return ERR_SSL_PROTOCOL_ERROR;
184+
case SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK:
185+
return ERR_SSL_INAPPROPRIATE_FALLBACK;
184186
default:
185187
LOG(WARNING) << "Unmapped error reason: " << ERR_GET_REASON(error_code);
186188
return ERR_FAILED;
@@ -754,6 +756,13 @@ bool SSLClientSocketOpenSSL::Init() {
754756
// handshake at which point the appropriate error is bubbled up to the client.
755757
LOG_IF(WARNING, rv != 1) << "SSL_set_cipher_list('" << command << "') "
756758
"returned " << rv;
759+
if (ssl_config_.version_fallback) {
760+
#ifdef SSL_MODE_SEND_FALLBACK_SCSV
761+
SSL_set_mode(ssl_, SSL_MODE_SEND_FALLBACK_SCSV);
762+
#else
763+
SSL_enable_fallback_scsv(ssl_);
764+
#endif
765+
}
757766

758767
// TLS channel ids.
759768
if (IsChannelIDEnabled(ssl_config_, server_bound_cert_service_)) {

0 commit comments

Comments
 (0)