5 SSL_CTX_config, SSL_config - configure SSL_CTX or SSL structure
9 #include <openssl/ssl.h>
11 int SSL_CTX_config(SSL_CTX *ctx, const char *name);
12 int SSL_config(SSL *s, const char *name);
16 The functions SSL_CTX_config() and SSL_config() configure an B<SSL_CTX> or
17 B<SSL> structure using the configuration B<name>.
21 By calling SSL_CTX_config() or SSL_config() an application can perform many
22 complex tasks based on the contents of the configuration file: greatly
23 simplifying application configuration code. A degree of future proofing
24 can also be achieved: an application can support configuration features
25 in newer versions of OpenSSL automatically.
27 A configuration file must have been previously loaded, for example using
28 CONF_modules_load_file(). See L<config(3)> for details of the configuration
33 SSL_CTX_config() and SSL_config() return 1 for success or 0 if an error
38 If the file "config.cnf" contains the following:
43 # list of confuration modules
49 server = server_section
53 RSA.Certificate = server-rsa.pem
54 ECDSA.Certificate = server-ecdsa.pem
57 An application could call:
59 if (CONF_modules_load_file("config.cnf", "testapp", 0) <= 0) {
60 fprintf(stderr, "Error processing config file\n");
64 ctx = SSL_CTX_new(TLS_server_method());
66 if (SSL_CTX_config(ctx, "server") == 0) {
67 fprintf(stderr, "Error configuring server.\n");
71 In this example two certificates and the cipher list are configured without
72 the need for any additional application code.
78 L<CONF_modules_load_file(3)>
82 SSL_CTX_config() and SSL_config() were first added to OpenSSL 1.1.0
86 Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
88 Licensed under the OpenSSL license (the "License"). You may not use
89 this file except in compliance with the License. You can obtain a copy
90 in the file LICENSE in the source distribution or at
91 L<https://www.openssl.org/source/license.html>.