Skip to content

Commit

Permalink
AppleTLS: TLSv3
Browse files Browse the repository at this point in the history
  • Loading branch information
nmaier committed Oct 6, 2019
1 parent 6b36224 commit a6671ae
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/AppleTLSSession.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@

namespace {
#if !defined(__MAC_10_8)
static const SSLProtocol kTLSProtocol11 = (SSLProtocol)(kSSLProtocolAll + 1);
static const SSLProtocol kTLSProtocol12 = (SSLProtocol)(kSSLProtocolAll + 2);
static const SSLProtocol kTLSProtocol11 = 7;
static const SSLProtocol kTLSProtocol12 = 8;
static const SSLProtocol kTLSProtocol13 = 13;
#endif

#ifndef CIPHER_NO_DHPARAM
Expand Down Expand Up @@ -92,6 +93,8 @@ static inline const char* protoToString(SSLProtocol proto)
return "TLSv1.1";
case kTLSProtocol12:
return "TLSv1.2";
case kTLSProtocol13:
return "TLSv1.3";
default:
return "Unknown";
}
Expand Down Expand Up @@ -382,6 +385,9 @@ AppleTLSSession::AppleTLSSession(AppleTLSContext* ctx)
case TLS_PROTO_TLS12:
(void)SSLSetProtocolVersionMin(sslCtx_, kTLSProtocol12);
break;
case TLS_PROTO_TLS13:
(void)SSLSetProtocolVersionMin(sslCtx_, kTLSProtocol13);
break;
default:
break;
}
Expand All @@ -393,6 +399,9 @@ AppleTLSSession::AppleTLSSession(AppleTLSContext* ctx)
// fall through
case TLS_PROTO_TLS12:
(void)SSLSetProtocolVersionEnabled(sslCtx_, kTLSProtocol12, true);
// fall through
case TLS_PROTO_TLS13:
(void)SSLSetProtocolVersionEnabled(sslCtx_, kTLSProtocol13, true);
default:
break;
}
Expand Down Expand Up @@ -742,6 +751,9 @@ int AppleTLSSession::tlsConnect(const std::string& hostname,
case kTLSProtocol12:
version = TLS_PROTO_TLS12;
break;
case kTLSProtocol13:
version = TLS_PROTO_TLS13;
break;
default:
version = TLS_PROTO_NONE;
break;
Expand Down

0 comments on commit a6671ae

Please sign in to comment.