Skip to content

Commit abe948f

Browse files
committed
BUG #19578256 --SSL SHOULD DEFAULT TO OFF FOR COMMUNITY EDITION
Merge of cset 8810 from trunk
1 parent 762d148 commit abe948f

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

include/violite.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -152,7 +152,7 @@ enum enum_ssl_init_error
152152
{
153153
SSL_INITERR_NOERROR= 0, SSL_INITERR_CERT, SSL_INITERR_KEY,
154154
SSL_INITERR_NOMATCH, SSL_INITERR_BAD_PATHS, SSL_INITERR_CIPHERS,
155-
SSL_INITERR_MEMFAIL, SSL_INITERR_LASTERR
155+
SSL_INITERR_MEMFAIL, SSL_INITERR_NO_USABLE_CTX, SSL_INITERR_LASTERR
156156
};
157157
const char* sslGetErrString(enum enum_ssl_init_error err);
158158

vio/viosslfactories.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -81,7 +81,8 @@ ssl_error_string[] =
8181
"Private key does not match the certificate public key",
8282
"SSL_CTX_set_default_verify_paths failed",
8383
"Failed to set ciphers to use",
84-
"SSL_CTX_new failed"
84+
"SSL_CTX_new failed",
85+
"SSL context is not usable without certificate and private key"
8586
};
8687

8788
const char*
@@ -279,6 +280,16 @@ new_VioSSLFd(const char *key_file, const char *cert_file,
279280
DBUG_RETURN(0);
280281
}
281282

283+
/* Server specific check : Must have certificate and key file */
284+
if (!is_client && !key_file && !cert_file)
285+
{
286+
*error= SSL_INITERR_NO_USABLE_CTX;
287+
DBUG_PRINT("error", ("%s", sslGetErrString(*error)));
288+
report_errors();
289+
my_free(ssl_fd);
290+
DBUG_RETURN(0);
291+
}
292+
282293
/* DH stuff */
283294
dh=get_dh512();
284295
SSL_CTX_set_tmp_dh(ssl_fd->ssl_context, dh);

0 commit comments

Comments
 (0)