1=pod 2 3=head1 NAME 4 5SSL_CTX_set_ssl_version, SSL_set_ssl_method, SSL_get_ssl_method 6- choose a new TLS/SSL method 7 8=head1 SYNOPSIS 9 10 #include <openssl/ssl.h> 11 12 int SSL_CTX_set_ssl_version(SSL_CTX *ctx, const SSL_METHOD *method); 13 int SSL_set_ssl_method(SSL *s, const SSL_METHOD *method); 14 const SSL_METHOD *SSL_get_ssl_method(const SSL *ssl); 15 16=head1 DESCRIPTION 17 18SSL_CTX_set_ssl_version() sets a new default TLS/SSL B<method> for SSL objects 19newly created from this B<ctx>. Most of the configuration attached to the 20SSL_CTX object is retained, with the exception of the configured TLS ciphers, 21which are reset to the default values. SSL objects already created from this 22SSL_CTX with L<SSL_new(3)> are not affected, except when L<SSL_clear(3)> is 23being called, as described below. 24 25SSL_set_ssl_method() sets a new TLS/SSL B<method> for a particular B<ssl> 26object. It may be reset, when SSL_clear() is called. 27 28SSL_get_ssl_method() returns a function pointer to the TLS/SSL method 29set in B<ssl>. 30 31=head1 NOTES 32 33The available B<method> choices are described in 34L<SSL_CTX_new(3)>. 35 36When L<SSL_clear(3)> is called and no session is connected to 37an SSL object, the method of the SSL object is reset to the method currently 38set in the corresponding SSL_CTX object. 39 40SSL_CTX_set_version() has unusual semantics and no clear use case; 41it would usually be preferable to create a new SSL_CTX object than to 42try to reuse an existing one in this fashion. Its usage is considered 43deprecated. 44 45=head1 RETURN VALUES 46 47The following return values can occur for SSL_CTX_set_ssl_version() 48and SSL_set_ssl_method(): 49 50=over 4 51 52=item Z<>0 53 54The new choice failed, check the error stack to find out the reason. 55 56=item Z<>1 57 58The operation succeeded. 59 60=back 61 62=head1 SEE ALSO 63 64L<SSL_CTX_new(3)>, L<SSL_new(3)>, 65L<SSL_clear(3)>, L<ssl(7)>, 66L<SSL_set_connect_state(3)> 67 68=head1 HISTORY 69 70SSL_CTX_set_ssl_version() was deprecated in OpenSSL 3.0. 71 72=head1 COPYRIGHT 73 74Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved. 75 76Licensed under the Apache License 2.0 (the "License"). You may not use 77this file except in compliance with the License. You can obtain a copy 78in the file LICENSE in the source distribution or at 79L<https://www.openssl.org/source/license.html>. 80 81=cut 82