|
1 | | -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. |
| 1 | +/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. |
2 | 2 |
|
3 | 3 | This program is free software; you can redistribute it and/or modify |
4 | 4 | it under the terms of the GNU General Public License as published by |
@@ -171,8 +171,27 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout, |
171 | 171 | SSL_clear(ssl); |
172 | 172 | SSL_SESSION_set_timeout(SSL_get_session(ssl), timeout); |
173 | 173 | SSL_set_fd(ssl, vio->sd); |
174 | | -#ifndef HAVE_YASSL |
175 | | - SSL_set_options(ssl, SSL_OP_NO_COMPRESSION); |
| 174 | +#if !defined(HAVE_YASSL) && defined(SSL_OP_NO_COMPRESSION) |
| 175 | + SSL_set_options(ssl, SSL_OP_NO_COMPRESSION); /* OpenSSL >= 1.0 only */ |
| 176 | +#elif OPENSSL_VERSION_NUMBER >= 0x00908000L /* workaround for OpenSSL 0.9.8 */ |
| 177 | + sk_SSL_COMP_zero(SSL_COMP_get_compression_methods()); |
| 178 | +#endif |
| 179 | + |
| 180 | +#if !defined(HAVE_YASSL) && !defined(DBUG_OFF) |
| 181 | + { |
| 182 | + STACK_OF(SSL_COMP) *ssl_comp_methods = NULL; |
| 183 | + ssl_comp_methods = SSL_COMP_get_compression_methods(); |
| 184 | + DBUG_PRINT("info", ("Available compression methods:\n")); |
| 185 | + int j, n = sk_SSL_COMP_num(ssl_comp_methods); |
| 186 | + if (n == 0) |
| 187 | + fprintf(stderr, " NONE\n"); |
| 188 | + else |
| 189 | + for (j = 0; j < n; j++) |
| 190 | + { |
| 191 | + SSL_COMP *c = sk_SSL_COMP_value(ssl_comp_methods, j); |
| 192 | + DBUG_PRINT("info", (" %d: %s\n", c->id, c->name)); |
| 193 | + } |
| 194 | + } |
176 | 195 | #endif |
177 | 196 |
|
178 | 197 | if ((r= connect_accept_func(ssl)) < 1) |
|
0 commit comments