Change default config version to development style
@@ -4210,37 +4210,39 @@ int mbedtls_ssl_config_defaults( mbedtls_ssl_config *conf,
conf->tls13_kex_modes = MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_ALL;
#endif /* MBEDTLS_SSL_PROTO_TLS1_3 */
+ if( transport == MBEDTLS_SSL_TRANSPORT_DATAGRAM )
+ {
#if defined(MBEDTLS_SSL_PROTO_TLS1_2)
conf->min_tls_version = MBEDTLS_SSL_VERSION_TLS1_2;
-#elif defined(MBEDTLS_SSL_PROTO_TLS1_3)
- conf->min_tls_version = MBEDTLS_SSL_VERSION_TLS1_3;
-#endif
-#if defined(MBEDTLS_SSL_PROTO_TLS1_2) && defined(MBEDTLS_SSL_PROTO_TLS1_3)
- if( transport == MBEDTLS_SSL_TRANSPORT_DATAGRAM ||
- endpoint == MBEDTLS_SSL_IS_SERVER )
- {
- /* DTLS 1.3 not supported yet
- * server side hybrid mode not support yet
- */
conf->max_tls_version = MBEDTLS_SSL_VERSION_TLS1_2;
+#else
+ return( MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE );
+#endif
}
else
{
- conf->max_tls_version = MBEDTLS_SSL_VERSION_TLS1_3;
- }
-#elif defined(MBEDTLS_SSL_PROTO_TLS1_2)
- conf->max_tls_version = MBEDTLS_SSL_VERSION_TLS1_2;
-#elif defined(MBEDTLS_SSL_PROTO_TLS1_3)
- if( transport != MBEDTLS_SSL_TRANSPORT_DATAGRAM )
+#if defined(MBEDTLS_SSL_PROTO_TLS1_2) && defined(MBEDTLS_SSL_PROTO_TLS1_3)
+ if( endpoint == MBEDTLS_SSL_IS_CLIENT )
{
+ conf->min_tls_version = MBEDTLS_SSL_VERSION_TLS1_2;
conf->max_tls_version = MBEDTLS_SSL_VERSION_TLS1_3;
}
else
+ /* Hybrid TLS 1.2 / 1.3 is not supported on server side yet */
{
- /* DTLS 1.3 not supported yet */
- return( MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE );
+ conf->min_tls_version = MBEDTLS_SSL_VERSION_TLS1_2;
+ conf->max_tls_version = MBEDTLS_SSL_VERSION_TLS1_2;
}
+#elif defined(MBEDTLS_SSL_PROTO_TLS1_3)
+ conf->min_tls_version = MBEDTLS_SSL_VERSION_TLS1_3;
+ conf->max_tls_version = MBEDTLS_SSL_VERSION_TLS1_3;
+#elif defined(MBEDTLS_SSL_PROTO_TLS1_2)
+ conf->min_tls_version = MBEDTLS_SSL_VERSION_TLS1_2;
+ conf->max_tls_version = MBEDTLS_SSL_VERSION_TLS1_2;
+#else
+ return( MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE );
#endif
+ }
/*
* Preset-specific defaults
