You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.1 KiB

  1. --- a/src/Mayaqua/Network.c
  2. +++ b/src/Mayaqua/Network.c
  3. @@ -12966,35 +12966,46 @@ bool StartSSLEx(SOCK *sock, X *x, K *pri
  4. {
  5. if (sock->ServerMode)
  6. {
  7. +#ifdef SSL3_SUPPORT
  8. if (sock->AcceptOnlyTls == false)
  9. {
  10. SSL_CTX_set_ssl_version(ssl_ctx, SSLv23_method());
  11. }
  12. else
  13. {
  14. +#endif
  15. SSL_CTX_set_ssl_version(ssl_ctx, TLSv1_method());
  16. +#ifdef SSL3_SUPPORT
  17. }
  18. -
  19. +#endif
  20. Unlock(openssl_lock);
  21. AddChainSslCertOnDirectory(ssl_ctx);
  22. Lock(openssl_lock);
  23. }
  24. else
  25. {
  26. +#ifdef SSL3_SUPPORT
  27. if (client_tls == false)
  28. {
  29. SSL_CTX_set_ssl_version(ssl_ctx, SSLv3_method());
  30. }
  31. else
  32. {
  33. +#endif
  34. SSL_CTX_set_ssl_version(ssl_ctx, TLSv1_client_method());
  35. +#ifdef SSL3_SUPPORT
  36. }
  37. +#endif
  38. }
  39. sock->ssl = SSL_new(ssl_ctx);
  40. SSL_set_fd(sock->ssl, (int)sock->socket);
  41. #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
  42. +# ifdef SSL3_SUPPORT
  43. if (sock->ServerMode == false && client_tls)
  44. +# else
  45. + if (sock->ServerMode == false)
  46. +#endif
  47. {
  48. if (IsEmptyStr(sni_hostname) == false)
  49. {