Wikipedia mentions that SecureTransport supports TLS version 1.3 (though they just refer to a twit from a cUrl's developer). Headers in Security framework, indeed, contain those two constants: kTLSProtocol13 and kTLSProtocolMaxSupported. However, if I try to set an upper limit to kTLSProtocol13, SSLSetProtocolVersionMax returns errIllegalParam. Worse so, I'm not able to set version to kTLSProtocolMaxSupported (the same error) and as a result I have max hardcoded to 1.2, which is not very smart/require fixes in future. Looking into the latest available source for SecureTransport:
static tls_protocol_version SSLProtocolToProtocolVersion(SSLProtocol protocol) {
switch (protocol) {
case kSSLProtocol2: return SSL_Version_2_0;
case kSSLProtocol3: return tls_protocol_version_SSL_3;
case kTLSProtocol1: return tls_protocol_version_TLS_1_0;
case kTLSProtocol11: return tls_protocol_version_TLS_1_1;
case kTLSProtocol12: return tls_protocol_version_TLS_1_2;
case kDTLSProtocol1: return tls_protocol_version_DTLS_1_0;
default: return tls_protocol_version_Undertermined;
}
}
Looks like none of those two constants is handled propery (I'm not sure about the actual implementation/binaries I have in SDK). SSLSetProtocolVersionMax will return an error on 'conversion' failure - the value tls_protocol_version_Undertermined == 0 and is < MIN_STREAM_VERSION:
OSStatus
SSLSetProtocolVersionMax (SSLContextRef ctx,
SSLProtocol maxVersion)
{
if(ctx == NULL) return errSecParam;
SSLProtocolVersion version = SSLProtocolToProtocolVersion(maxVersion);
if (ctx->isDTLS) {
if (version > MINIMUM_DATAGRAM_VERSION ||
version < MAXIMUM_DATAGRAM_VERSION)
return errSSLIllegalParam;
if (version > ctx->minProtocolVersion)
ctx->minProtocolVersion = version;
} else {
if (version < MINIMUM_STREAM_VERSION || version > MAXIMUM_STREAM_VERSION)
return errSSLIllegalParam;
if (version < ctx->minProtocolVersion)
ctx->minProtocolVersion = version;
}
ctx->maxProtocolVersion = version;
tls_handshake_set_min_protocol_version(ctx->hdsk, ctx->minProtocolVersion);
tls_handshake_set_max_protocol_version(ctx->hdsk, ctx->maxProtocolVersion);
return errSecSuccess;
}
So the question is: if TLS 1.3 is supported by SecureTransport and how do I enable it or enable the future versions too using 'max supported'?