Skip to content

Commit

Permalink
Default TLS mode now accepts TLS v1.2, v1.1 and v1.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralight committed May 24, 2014
1 parent 94ec279 commit ae6baad
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 2 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
- Default TLS mode now accepts TLS v1.2, v1.1 and v1.0.

1.3.2 - 2014xxxx
================

Expand Down
10 changes: 6 additions & 4 deletions man/mosquitto.conf.5.xml
Original file line number Diff line number Diff line change
Expand Up @@ -740,8 +740,9 @@
used for this listener. Possible values are
<replaceable>tlsv1.2</replaceable>,
<replaceable>tlsv1.1</replaceable> and
<replaceable>tlsv1</replaceable>. Defaults to
<replaceable>tlsv1.2</replaceable>.</para>
<replaceable>tlsv1</replaceable>. If left unset,
the default of allowing all of TLS v1.2, v1.1 and
v1.0 is used.</para>
</listitem>
</varlistentry>
<varlistentry>
Expand Down Expand Up @@ -800,8 +801,9 @@
used for this listener. Possible values are
<replaceable>tlsv1.2</replaceable>,
<replaceable>tlsv1.1</replaceable> and
<replaceable>tlsv1</replaceable>. Defaults to
<replaceable>tlsv1.2</replaceable>.</para>
<replaceable>tlsv1</replaceable>. If left unset,
the default of allowing all of TLS v1.2, v1.1 and
v1.0 is used.</para>
</listitem>
</varlistentry>
<varlistentry>
Expand Down
2 changes: 1 addition & 1 deletion mosquitto.conf
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
#keyfile

# This option defines the version of the TLS protocol to use for this listener.
# The default value will always be the highest version that is available for
# The default value allows v1.2, v1.1 and v1.0, if they are all supported by
# the version of openssl that the broker was compiled against. For openssl >=
# 1.0.1 the valid values are tlsv1.2 tlsv1.1 and tlsv1. For openssl < 1.0.1 the
# valid values are tlsv1.
Expand Down
4 changes: 2 additions & 2 deletions src/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,13 +342,13 @@ int mqtt3_socket_listen(struct _mqtt3_listener *listener)
if((listener->cafile || listener->capath) && listener->certfile && listener->keyfile){
#if OPENSSL_VERSION_NUMBER >= 0x10001000L
if(listener->tls_version == NULL){
listener->ssl_ctx = SSL_CTX_new(TLSv1_2_server_method());
listener->ssl_ctx = SSL_CTX_new(SSLv23_server_method());
}else if(!strcmp(listener->tls_version, "tlsv1.2")){
listener->ssl_ctx = SSL_CTX_new(TLSv1_2_server_method());
}else if(!strcmp(listener->tls_version, "tlsv1.1")){
listener->ssl_ctx = SSL_CTX_new(TLSv1_1_server_method());
}else if(!strcmp(listener->tls_version, "tlsv1")){
listener->ssl_ctx = SSL_CTX_new(SSLv23_server_method());
listener->ssl_ctx = SSL_CTX_new(TLSv1_server_method());
}
#else
listener->ssl_ctx = SSL_CTX_new(SSLv23_server_method());
Expand Down

0 comments on commit ae6baad

Please sign in to comment.