/*++ /* NAME /* tlsproxy 8 /* SUMMARY /* Postfix TLS proxy /* SYNOPSIS /* \fBtlsproxy\fR [generic Postfix daemon options] /* DESCRIPTION /* The \fBtlsproxy\fR(8) server implements a two-way TLS proxy. It /* is used by the \fBpostscreen\fR(8) server to talk SMTP-over-TLS /* with remote SMTP clients that are not allowlisted (including /* clients whose allowlist status has expired), and by the /* \fBsmtp\fR(8) client to support TLS connection reuse, but it /* should also work for non-SMTP protocols. /* /* Although one \fBtlsproxy\fR(8) process can serve multiple /* sessions at the same time, it is a good idea to allow the /* number of processes to increase with load, so that the /* service remains responsive. /* PROTOCOL EXAMPLE /* .ad /* .fi /* The example below concerns \fBpostscreen\fR(8). However, /* the \fBtlsproxy\fR(8) server is agnostic of the application /* protocol, and the example is easily adapted to other /* applications. /* /* After receiving a valid remote SMTP client STARTTLS command, /* the \fBpostscreen\fR(8) server sends the remote SMTP client /* endpoint string, the requested role (server), and the /* requested timeout to \fBtlsproxy\fR(8). \fBpostscreen\fR(8) /* then receives a "TLS available" indication from \fBtlsproxy\fR(8). /* If the TLS service is available, \fBpostscreen\fR(8) sends /* the remote SMTP client file descriptor to \fBtlsproxy\fR(8), /* and sends the plaintext 220 greeting to the remote SMTP /* client. This triggers TLS negotiations between the remote /* SMTP client and \fBtlsproxy\fR(8). Upon completion of the /* TLS-level handshake, \fBtlsproxy\fR(8) translates between /* plaintext from/to \fBpostscreen\fR(8) and ciphertext to/from /* the remote SMTP client. /* SECURITY /* .ad /* .fi /* The \fBtlsproxy\fR(8) server is moderately security-sensitive. /* It talks to untrusted clients on the network. The process /* can be run chrooted at fixed low privilege. /* DIAGNOSTICS /* Problems and transactions are logged to \fBsyslogd\fR(8) /* or \fBpostlogd\fR(8). /* CONFIGURATION PARAMETERS /* .ad /* .fi /* Changes to \fBmain.cf\fR are not picked up automatically, /* as \fBtlsproxy\fR(8) processes may run for a long time /* depending on mail server load. Use the command "\fBpostfix /* reload\fR" to speed up a change. /* /* The text below provides only a parameter summary. See /* \fBpostconf\fR(5) for more details including examples. /* STARTTLS GLOBAL CONTROLS /* .ad /* .fi /* The following settings are global and therefore cannot be /* overruled by information specified in a \fBtlsproxy\fR(8) /* client request. /* .IP "\fBtls_append_default_CA (no)\fR" /* Append the system-supplied default Certification Authority /* certificates to the ones specified with *_tls_CApath or *_tls_CAfile. /* .IP "\fBtls_daemon_random_bytes (32)\fR" /* The number of pseudo-random bytes that an \fBsmtp\fR(8) or \fBsmtpd\fR(8) /* process requests from the \fBtlsmgr\fR(8) server in order to seed its /* internal pseudo random number generator (PRNG). /* .IP "\fBtls_high_cipherlist (see 'postconf -d' output)\fR" /* The OpenSSL cipherlist for "high" grade ciphers. /* .IP "\fBtls_medium_cipherlist (see 'postconf -d' output)\fR" /* The OpenSSL cipherlist for "medium" or higher grade ciphers. /* .IP "\fBtls_null_cipherlist (eNULL:!aNULL)\fR" /* The OpenSSL cipherlist for "NULL" grade ciphers that provide /* authentication without encryption. /* .IP "\fBtls_eecdh_strong_curve (prime256v1)\fR" /* The elliptic curve used by the Postfix SMTP server for sensibly /* strong /* ephemeral ECDH key exchange. /* .IP "\fBtls_eecdh_ultra_curve (secp384r1)\fR" /* The elliptic curve used by the Postfix SMTP server for maximally /* strong /* ephemeral ECDH key exchange. /* .IP "\fBtls_disable_workarounds (see 'postconf -d' output)\fR" /* List or bit-mask of OpenSSL bug work-arounds to disable. /* .IP "\fBtls_preempt_cipherlist (no)\fR" /* With SSLv3 and later, use the Postfix SMTP server's cipher /* preference order instead of the remote client's cipher preference /* order. /* .PP /* Available in Postfix version 2.8..3.7: /* .IP "\fBtls_low_cipherlist (see 'postconf -d' output)\fR" /* The OpenSSL cipherlist for "low" or higher grade ciphers. /* .IP "\fBtls_export_cipherlist (see 'postconf -d' output)\fR" /* The OpenSSL cipherlist for "export" or higher grade ciphers. /* .PP /* Available in Postfix version 2.9 and later: /* .IP "\fBtls_legacy_public_key_fingerprints (no)\fR" /* A temporary migration aid for sites that use certificate /* \fIpublic-key\fR fingerprints with Postfix 2.9.0..2.9.5, which use /* an incorrect algorithm. /* .PP /* Available in Postfix version 2.11-3.1: /* .IP "\fBtls_dane_digest_agility (on)\fR" /* Configure RFC7671 DANE TLSA digest algorithm agility. /* .IP "\fBtls_dane_trust_anchor_digest_enable (yes)\fR" /* Enable support for RFC 6698 (DANE TLSA) DNS records that contain /* digests of trust-anchors with certificate usage "2". /* .PP /* Available in Postfix version 2.11 and later: /* .IP "\fBtlsmgr_service_name (tlsmgr)\fR" /* The name of the \fBtlsmgr\fR(8) service entry in master.cf. /* .PP /* Available in Postfix version 3.0 and later: /* .IP "\fBtls_session_ticket_cipher (Postfix >= 3.0: aes-256-cbc, Postfix < 3.0: aes-128-cbc)\fR" /* Algorithm used to encrypt RFC5077 TLS session tickets. /* .IP "\fBopenssl_path (openssl)\fR" /* The location of the OpenSSL command line program \fBopenssl\fR(1). /* .PP /* Available in Postfix version 3.2 and later: /* .IP "\fBtls_eecdh_auto_curves (see 'postconf -d' output)\fR" /* The prioritized list of elliptic curves, that should be enabled in the /* Postfix SMTP client and server. /* .PP /* Available in Postfix version 3.4 and later: /* .IP "\fBtls_server_sni_maps (empty)\fR" /* Optional lookup tables that map names received from remote SMTP /* clients via the TLS Server Name Indication (SNI) extension to the /* appropriate keys and certificate chains. /* .PP /* Available in Postfix 3.5, 3.4.6, 3.3.5, 3.2.10, 3.1.13 and later: /* .IP "\fBtls_fast_shutdown_enable (yes)\fR" /* A workaround for implementations that hang Postfix while shutting /* down a TLS session, until Postfix times out. /* .PP /* Available in Postfix version 3.8 and later: /* .IP "\fBtls_ffdhe_auto_groups (see 'postconf -d' output)\fR" /* The prioritized list of finite-field Diffie-Hellman ephemeral /* (FFDHE) key exchange groups supported by the Postfix SMTP client and /* server. /* .PP /* Available in Postfix 3.9, 3.8.1, 3.7.6, 3.6.10, 3.5.20 and later: /* .IP "\fBtls_config_file (default)\fR" /* Optional configuration file with baseline OpenSSL settings. /* .IP "\fBtls_config_name (empty)\fR" /* The application name passed by Postfix to OpenSSL library /* initialization functions. /* STARTTLS SERVER CONTROLS /* .ad /* .fi /* These settings are clones of Postfix SMTP server settings. /* They allow \fBtlsproxy\fR(8) to load the same certificate /* and private key information as the Postfix SMTP server, /* before dropping privileges, so that the key files can be /* kept read-only for root. These settings can currently not /* be overruled by information in a \fBtlsproxy\fR(8) client /* request, but that limitation may be removed in a future /* version. /* .IP "\fBtlsproxy_tls_CAfile ($smtpd_tls_CAfile)\fR" /* A file containing (PEM format) CA certificates of root CAs /* trusted to sign either remote SMTP client certificates or intermediate /* CA certificates. /* .IP "\fBtlsproxy_tls_CApath ($smtpd_tls_CApath)\fR" /* A directory containing (PEM format) CA certificates of root CAs /* trusted to sign either remote SMTP client certificates or intermediate /* CA certificates. /* .IP "\fBtlsproxy_tls_always_issue_session_ids ($smtpd_tls_always_issue_session_ids)\fR" /* Force the Postfix \fBtlsproxy\fR(8) server to issue a TLS session id, /* even when TLS session caching is turned off. /* .IP "\fBtlsproxy_tls_ask_ccert ($smtpd_tls_ask_ccert)\fR" /* Ask a remote SMTP client for a client certificate. /* .IP "\fBtlsproxy_tls_ccert_verifydepth ($smtpd_tls_ccert_verifydepth)\fR" /* The verification depth for remote SMTP client certificates. /* .IP "\fBtlsproxy_tls_cert_file ($smtpd_tls_cert_file)\fR" /* File with the Postfix \fBtlsproxy\fR(8) server RSA certificate in PEM /* format. /* .IP "\fBtlsproxy_tls_ciphers ($smtpd_tls_ciphers)\fR" /* The minimum TLS cipher grade that the Postfix \fBtlsproxy\fR(8) server /* will use with opportunistic TLS encryption. /* .IP "\fBtlsproxy_tls_dcert_file ($smtpd_tls_dcert_file)\fR" /* File with the Postfix \fBtlsproxy\fR(8) server DSA certificate in PEM /* format. /* .IP "\fBtlsproxy_tls_dh1024_param_file ($smtpd_tls_dh1024_param_file)\fR" /* File with DH parameters that the Postfix \fBtlsproxy\fR(8) server /* should use with non-export EDH ciphers. /* .IP "\fBtlsproxy_tls_dh512_param_file ($smtpd_tls_dh512_param_file)\fR" /* File with DH parameters that the Postfix \fBtlsproxy\fR(8) server /* should use with export-grade EDH ciphers. /* .IP "\fBtlsproxy_tls_dkey_file ($smtpd_tls_dkey_file)\fR" /* File with the Postfix \fBtlsproxy\fR(8) server DSA private key in PEM /* format. /* .IP "\fBtlsproxy_tls_eccert_file ($smtpd_tls_eccert_file)\fR" /* File with the Postfix \fBtlsproxy\fR(8) server ECDSA certificate in PEM /* format. /* .IP "\fBtlsproxy_tls_eckey_file ($smtpd_tls_eckey_file)\fR" /* File with the Postfix \fBtlsproxy\fR(8) server ECDSA private key in PEM /* format. /* .IP "\fBtlsproxy_tls_eecdh_grade ($smtpd_tls_eecdh_grade)\fR" /* The Postfix \fBtlsproxy\fR(8) server security grade for ephemeral /* elliptic-curve Diffie-Hellman (EECDH) key exchange. /* .IP "\fBtlsproxy_tls_exclude_ciphers ($smtpd_tls_exclude_ciphers)\fR" /* List of ciphers or cipher types to exclude from the \fBtlsproxy\fR(8) /* server cipher list at all TLS security levels. /* .IP "\fBtlsproxy_tls_fingerprint_digest ($smtpd_tls_fingerprint_digest)\fR" /* The message digest algorithm to construct remote SMTP /* client-certificate /* fingerprints. /* .IP "\fBtlsproxy_tls_key_file ($smtpd_tls_key_file)\fR" /* File with the Postfix \fBtlsproxy\fR(8) server RSA private key in PEM /* format. /* .IP "\fBtlsproxy_tls_loglevel ($smtpd_tls_loglevel)\fR" /* Enable additional Postfix \fBtlsproxy\fR(8) server logging of TLS /* activity. /* .IP "\fBtlsproxy_tls_mandatory_ciphers ($smtpd_tls_mandatory_ciphers)\fR" /* The minimum TLS cipher grade that the Postfix \fBtlsproxy\fR(8) server /* will use with mandatory TLS encryption. /* .IP "\fBtlsproxy_tls_mandatory_exclude_ciphers ($smtpd_tls_mandatory_exclude_ciphers)\fR" /* Additional list of ciphers or cipher types to exclude from the /* \fBtlsproxy\fR(8) server cipher list at mandatory TLS security levels. /* .IP "\fBtlsproxy_tls_mandatory_protocols ($smtpd_tls_mandatory_protocols)\fR" /* The SSL/TLS protocols accepted by the Postfix \fBtlsproxy\fR(8) server /* with mandatory TLS encryption. /* .IP "\fBtlsproxy_tls_protocols ($smtpd_tls_protocols)\fR" /* List of TLS protocols that the Postfix \fBtlsproxy\fR(8) server will /* exclude or include with opportunistic TLS encryption. /* .IP "\fBtlsproxy_tls_req_ccert ($smtpd_tls_req_ccert)\fR" /* With mandatory TLS encryption, require a trusted remote SMTP /* client certificate in order to allow TLS connections to proceed. /* .IP "\fBtlsproxy_tls_security_level ($smtpd_tls_security_level)\fR" /* The SMTP TLS security level for the Postfix \fBtlsproxy\fR(8) server; /* when a non-empty value is specified, this overrides the obsolete /* parameters smtpd_use_tls and smtpd_enforce_tls. /* .IP "\fBtlsproxy_tls_chain_files ($smtpd_tls_chain_files)\fR" /* Files with the Postfix \fBtlsproxy\fR(8) server keys and certificate /* chains in PEM format. /* .PP /* Available in Postfix version 3.9 and later: /* .IP "\fBtlsproxy_tls_enable_rpk ($smtpd_tls_enable_rpk)\fR" /* Request that remote SMTP clients send an RFC7250 raw public key /* instead of an X.509 certificate, when asking or requiring client /* authentication. /* STARTTLS CLIENT CONTROLS /* .ad /* .fi /* These settings are clones of Postfix SMTP client settings. /* They allow \fBtlsproxy\fR(8) to load the same certificate /* and private key information as the Postfix SMTP client, /* before dropping privileges, so that the key files can be /* kept read-only for root. Some settings may be overruled by /* information in a \fBtlsproxy\fR(8) client request. /* .PP /* Available in Postfix version 3.4 and later: /* .IP "\fBtlsproxy_client_CAfile ($smtp_tls_CAfile)\fR" /* A file containing CA certificates of root CAs trusted to sign /* either remote TLS server certificates or intermediate CA certificates. /* .IP "\fBtlsproxy_client_CApath ($smtp_tls_CApath)\fR" /* Directory with PEM format Certification Authority certificates /* that the Postfix \fBtlsproxy\fR(8) client uses to verify a remote TLS /* server certificate. /* .IP "\fBtlsproxy_client_chain_files ($smtp_tls_chain_files)\fR" /* Files with the Postfix \fBtlsproxy\fR(8) client keys and certificate /* chains in PEM format. /* .IP "\fBtlsproxy_client_cert_file ($smtp_tls_cert_file)\fR" /* File with the Postfix \fBtlsproxy\fR(8) client RSA certificate in PEM /* format. /* .IP "\fBtlsproxy_client_key_file ($smtp_tls_key_file)\fR" /* File with the Postfix \fBtlsproxy\fR(8) client RSA private key in PEM /* format. /* .IP "\fBtlsproxy_client_dcert_file ($smtp_tls_dcert_file)\fR" /* File with the Postfix \fBtlsproxy\fR(8) client DSA certificate in PEM /* format. /* .IP "\fBtlsproxy_client_dkey_file ($smtp_tls_dkey_file)\fR" /* File with the Postfix \fBtlsproxy\fR(8) client DSA private key in PEM /* format. /* .IP "\fBtlsproxy_client_eccert_file ($smtp_tls_eccert_file)\fR" /* File with the Postfix \fBtlsproxy\fR(8) client ECDSA certificate in PEM /* format. /* .IP "\fBtlsproxy_client_eckey_file ($smtp_tls_eckey_file)\fR" /* File with the Postfix \fBtlsproxy\fR(8) client ECDSA private key in PEM /* format. /* .IP "\fBtlsproxy_client_fingerprint_digest ($smtp_tls_fingerprint_digest)\fR" /* The message digest algorithm used to construct remote TLS server /* certificate fingerprints. /* .IP "\fBtlsproxy_client_loglevel ($smtp_tls_loglevel)\fR" /* Enable additional Postfix \fBtlsproxy\fR(8) client logging of TLS /* activity. /* .IP "\fBtlsproxy_client_loglevel_parameter (smtp_tls_loglevel)\fR" /* The name of the parameter that provides the tlsproxy_client_loglevel /* value. /* .IP "\fBtlsproxy_client_scert_verifydepth ($smtp_tls_scert_verifydepth)\fR" /* The verification depth for remote TLS server certificates. /* .IP "\fBtlsproxy_client_use_tls ($smtp_use_tls)\fR" /* Opportunistic mode: use TLS when a remote server announces TLS /* support. /* .IP "\fBtlsproxy_client_enforce_tls ($smtp_enforce_tls)\fR" /* Enforcement mode: require that SMTP servers use TLS encryption. /* .IP "\fBtlsproxy_client_per_site ($smtp_tls_per_site)\fR" /* Optional lookup tables with the Postfix \fBtlsproxy\fR(8) client TLS /* usage policy by next-hop destination and by remote TLS server /* hostname. /* .PP /* Available in Postfix version 3.4-3.6: /* .IP "\fBtlsproxy_client_level ($smtp_tls_security_level)\fR" /* The default TLS security level for the Postfix \fBtlsproxy\fR(8) /* client. /* .IP "\fBtlsproxy_client_policy ($smtp_tls_policy_maps)\fR" /* Optional lookup tables with the Postfix \fBtlsproxy\fR(8) client TLS /* security policy by next-hop destination. /* .PP /* Available in Postfix version 3.7 and later: /* .IP "\fBtlsproxy_client_security_level ($smtp_tls_security_level)\fR" /* The default TLS security level for the Postfix \fBtlsproxy\fR(8) /* client. /* .IP "\fBtlsproxy_client_policy_maps ($smtp_tls_policy_maps)\fR" /* Optional lookup tables with the Postfix \fBtlsproxy\fR(8) client TLS /* security policy by next-hop destination. /* OBSOLETE STARTTLS SUPPORT CONTROLS /* .ad /* .fi /* These parameters are supported for compatibility with /* \fBsmtpd\fR(8) legacy parameters. /* .IP "\fBtlsproxy_use_tls ($smtpd_use_tls)\fR" /* Opportunistic TLS: announce STARTTLS support to remote SMTP clients, /* but do not require that clients use TLS encryption. /* .IP "\fBtlsproxy_enforce_tls ($smtpd_enforce_tls)\fR" /* Mandatory TLS: announce STARTTLS support to remote SMTP clients, and /* require that clients use TLS encryption. /* .IP "\fBtlsproxy_client_use_tls ($smtp_use_tls)\fR" /* Opportunistic mode: use TLS when a remote server announces TLS /* support. /* .IP "\fBtlsproxy_client_enforce_tls ($smtp_enforce_tls)\fR" /* Enforcement mode: require that SMTP servers use TLS encryption. /* RESOURCE CONTROLS /* .ad /* .fi /* .IP "\fBtlsproxy_watchdog_timeout (10s)\fR" /* How much time a \fBtlsproxy\fR(8) process may take to process local /* or remote I/O before it is terminated by a built-in watchdog timer. /* MISCELLANEOUS CONTROLS /* .ad /* .fi /* .IP "\fBconfig_directory (see 'postconf -d' output)\fR" /* The default location of the Postfix main.cf and master.cf /* configuration files. /* .IP "\fBprocess_id (read-only)\fR" /* The process ID of a Postfix command or daemon process. /* .IP "\fBprocess_name (read-only)\fR" /* The process name of a Postfix command or daemon process. /* .IP "\fBsyslog_facility (mail)\fR" /* The syslog facility of Postfix logging. /* .IP "\fBsyslog_name (see 'postconf -d' output)\fR" /* A prefix that is prepended to the process name in syslog /* records, so that, for example, "smtpd" becomes "prefix/smtpd". /* .PP /* Available in Postfix 3.3 and later: /* .IP "\fBservice_name (read-only)\fR" /* The master.cf service name of a Postfix daemon process. /* SEE ALSO /* postscreen(8), Postfix zombie blocker /* smtpd(8), Postfix SMTP server /* postconf(5), configuration parameters /* postlogd(8), Postfix logging /* syslogd(8), system logging /* LICENSE /* .ad /* .fi /* The Secure Mailer license must be distributed with this software. /* HISTORY /* .ad /* .fi /* This service was introduced with Postfix version 2.8. /* AUTHOR(S) /* Wietse Venema /* IBM T.J. Watson Research /* P.O. Box 704 /* Yorktown Heights, NY 10598, USA /* /* Wietse Venema /* Google, Inc. /* 111 8th Avenue /* New York, NY 10011, USA
/*--*/
/* tlsp_strategy - decide what to read or write next. */
staticvoid tlsp_strategy(TLSP_STATE *state)
{
TLS_SESS_STATE *tls_context = state->tls_context;
NBBIO *plaintext_buf; int ssl_stat; int ssl_read_err; int ssl_write_err; int handshake_err;
/* *Donotenableplain-textI/ObeforecompletingtheTLShandshake. *Otherwisetheremotepeercanprependplaintexttotheoptional *TLS_SESS_STATEobject.
*/ if (state->flags & TLSP_FLAG_DO_HANDSHAKE) {
state->timeout = state->handshake_timeout;
ERR_clear_error(); if (state->is_server_role)
ssl_stat = SSL_accept(tls_context->con); else
ssl_stat = SSL_connect(tls_context->con); if (ssl_stat != 1) {
handshake_err = SSL_get_error(tls_context->con, ssl_stat);
tlsp_eval_tls_error(state, handshake_err); /* At this point, state could be a dangling pointer. */ return;
}
state->flags &= ~TLSP_FLAG_DO_HANDSHAKE;
state->timeout = state->session_timeout; if (tlsp_post_handshake(state) != TLSP_STAT_OK) { /* At this point, state is a dangling pointer. */ return;
}
}
/* *Shutdownandself-destructafterNBBIOerror.Thisautomagically *cleansupallpendingread/writeandtimeouteventrequests. *BeforeshuttingdownTLS,westopallplain-textI/Oeventsbut *keeptheNBBIOerrorflags.
*/
plaintext_buf = state->plaintext_buf; if (NBBIO_ERROR_FLAGS(plaintext_buf)) { if (NBBIO_ACTIVE_FLAGS(plaintext_buf))
nbbio_disable_readwrite(state->plaintext_buf);
ERR_clear_error(); if (!SSL_in_init(tls_context->con)
&& (ssl_stat = SSL_shutdown(tls_context->con)) < 0) {
handshake_err = SSL_get_error(tls_context->con, ssl_stat);
tlsp_eval_tls_error(state, handshake_err); /* At this point, state could be a dangling pointer. */ return;
}
tlsp_state_free(state); return;
}
/* *Trytoenable/disableciphertextread/writeevents.IfSSL_write() *wassatisfied,seeifSSL_read()wantstodosomework.Incaseof *anunrecoverableerror,thisautomagicallydestroysthesession *stateaftercleaningupallpendingread/writeandtimeoutevent *requests.
*/ if (tlsp_eval_tls_error(state, ssl_write_err != SSL_ERROR_NONE ?
ssl_write_err : ssl_read_err) < 0) /* At this point, state is a dangling pointer. */ return;
}
/* *Safetyalert:theplaintextpseudothreadshave"slumbered"fortoo *long(seecodeabove).Thismeansthattheciphertextpseudothreads *arestuck.
*/ if ((NBBIO_ERROR_FLAGS(state->plaintext_buf) & NBBIO_FLAG_TIMEOUT) != 0
&& NBBIO_ACTIVE_FLAGS(state->plaintext_buf) == 0)
msg_warn("deadlock on ciphertext stream for %s", state->remote_endpt);
/* *Thisiseasy,becausetheNBBIOlayerhasalreadydonetheevent *decodingandplaintextI/Oforus.Allweneedtodoisdecideifwe *wanttoreadorwritemoreplaintext.
*/
tlsp_strategy(state); /* At this point, state could be a dangling pointer. */
}
/* tlsp_ciphertext_event - ciphertext is ready to read/write */
/* *PerformtheTLSlayerbefore-handshakeinitialization.Weperformthe *remainderaftertheactualTLShandshakecompletes.
*/ if (state->is_server_role)
status = tlsp_server_start_pre_handshake(state); else
status = tlsp_client_start_pre_handshake(state); if (status != TLSP_STAT_OK) /* At this point, state is a dangling pointer. */ return;
/* *TriggertheinitialproxyserverI/Os.
*/
tlsp_strategy(state); /* At this point, state could be a dangling pointer. */
}
if (tlsp_pre_jail_done
&& strcmp(tlsp_pre_jail_client_init_key, init_key) != 0
&& (NOT_EMPTY(init_props->chain_files)
|| NOT_EMPTY(init_props->cert_file)
|| NOT_EMPTY(init_props->key_file)
|| NOT_EMPTY(init_props->dcert_file)
|| NOT_EMPTY(init_props->dkey_file)
|| NOT_EMPTY(init_props->eccert_file)
|| NOT_EMPTY(init_props->eckey_file)
|| NOT_EMPTY(init_props->CAfile)
|| NOT_EMPTY(init_props->CApath))) {
msg_warn("request from tlsproxy client with unexpected settings");
tlsp_log_config_diff(tlsp_pre_jail_client_init_key, init_key);
log_hints = 1;
}
} if (log_hints)
msg_warn("to avoid this warning, 1) identify the tlsproxy " "client that is making this request, 2) configure " "a custom tlsproxy service with settings that " "match that tlsproxy client, and 3) configure " "that tlsproxy client with a tlsproxy_service_name " "setting that resolves to that custom tlsproxy " "service");
staticvoid pre_jail_init_server(void)
{
TLS_SERVER_INIT_PROPS props; constchar *cert_file; int have_server_cert; int no_server_cert_ok; int require_server_cert;
/* *Thecodeinthisroutineispastedliterallyfromsmtpd(8).Iamnot *goingtosanitizethisbecausedoingsosurelywillbreakthingsin *unexpectedways.
*/ if (*var_tlsp_tls_level) { switch (tls_level_lookup(var_tlsp_tls_level)) { default:
msg_fatal("Invalid TLS level \"%s\"", var_tlsp_tls_level); /* NOTREACHED */ break; case TLS_LEV_SECURE: case TLS_LEV_VERIFY: case TLS_LEV_FPRINT:
msg_warn("%s: unsupported TLS level \"%s\", using \"encrypt\"",
VAR_TLSP_TLS_LEVEL, var_tlsp_tls_level); /* FALLTHROUGH */ case TLS_LEV_ENCRYPT:
var_tlsp_enforce_tls = var_tlsp_use_tls = 1; break; case TLS_LEV_MAY:
var_tlsp_enforce_tls = 0;
var_tlsp_use_tls = 1; break; case TLS_LEV_NONE:
var_tlsp_enforce_tls = var_tlsp_use_tls = 0; break;
}
}
var_tlsp_use_tls = var_tlsp_use_tls || var_tlsp_enforce_tls; if (!var_tlsp_use_tls) {
server_role_disabled = "TLS server role is disabled by configuration"; return;
}
if (*var_tlsp_tls_chain_files != 0) { if (!have_server_cert)
have_server_cert = 1; else
msg_warn("Both %s and one or more of the legacy " " %s, %s or %s are non-empty; the legacy " " parameters will be ignored",
VAR_TLSP_TLS_CHAIN_FILES,
VAR_TLSP_TLS_CERT_FILE,
VAR_TLSP_TLS_ECCERT_FILE,
VAR_TLSP_TLS_DCERT_FILE);
} /* Some TLS configuration errors are not show stoppers. */ if (!have_server_cert && require_server_cert)
msg_warn("Need a server cert to request client certs"); if (!var_tlsp_enforce_tls && var_tlsp_tls_req_ccert)
msg_warn("Can't require client certs unless TLS is required"); /* After a show-stopper error, log a warning. */ if (have_server_cert || (no_server_cert_ok && !require_server_cert)) {
/* tlsp_service - respond to external trigger(s), non-TLS version */
staticvoid tlsp_service(VSTREAM *stream, char *unused_service, char **unused_argv)
{
msg_info("TLS support is not compiled in -- exiting");
event_server_disconnect(stream);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.