Problem
Sendmail isn't setup to transfer mail through SMTP over
TLS whenever possible. This is desired for multiple
security reasons. Authentication, Privacy and
Confidentiality being some the top reasons. Mutual
authentication being the ideal. You also get integrity and
protection against malicious modification of the data stream
when you have mutual authentication.How do we setup Sendmail to provide this ability? TLS 1.2
or above is becoming a requirement.TLS is an extension to plaintext protocols including SMTP,
IMAP, and POP3. It's defined by RFC 3207. Other RFCs define
TLS v1.1 and TLS v1.2, and a draft defines TLS v1.3See:
TLS v1 https://tools.ietf.org/html/rfc3207
TLS v1.1 https://tools.ietf.org/html/rfc4346
TLS v1.2 https://tools.ietf.org/html/rfc5246
TLS v1.3 https://tools.ietf.org/html/draft-ietf-tls-tls13-28Currently only OpenServer 10 supports TLS v1.2 and above. OpenServer 6 2018 and UnixWare 7 2018 see: TA 127973
Solution
Setup TLS for Sendmail-SMTP-AUTH-TLS to use startssl.
The steps are as follows:1. Verify the Operating System (OS) installed is at least
Definitive 2018 or newer and fully patched. Update all
patches for the OS using `patchck` and verify sendmail.2. Prepare, Create and install certificates in /etc/mail/certs/.
3. Add options by editing the .mc file for the OS and add required modifications: Example OpenServer 6 the file is /etc/mail/cf/cf/sco.osr6.mc
4. Generate a new sendmail.cf using "mkdev cf"5. TestStep 1)A. Make sure your have Definitive 2018 versions or newer:
OpenServer6 Definitive 2018 (6D2M1) use:
pkginfo Xinuososr6dUnixWare7 Definitive 2018 (7D2M1) use:
pkginfo uw714pd2m1Or, if you have patchck version 19060502 or above, you can use: patchck version
On OpenServer6 Definitive 2018 (6D2M1):# patchck checkINSTALLED currently on example.com
--------------------------------------------------------------------
oss716k oss716k - OpenServer Supplement oss716k
oss725f oss725f - OpenServer Supplement oss725f
oss726a oss726a - OpenServer 6 Definitive 2018 Supplement
rs600d rs600d - OpenServer Release Supplement rs600d
rs600e rs600e - OpenServer Release Supplement rs600e
sasl sasl 2.1.23Ca - Cyrus SASL API implementation
patchck patchck 19031403 - Package Installation Tool
sysinfo sysinfo 19031403 - Information Gathering Tool
oss717b Berkeley-DB Database Library 4.6.21p4 update
oss719b Cyrus SASL API update for SCO OpenServer 6 Definitive
oss720b OpenLDAP update for SCO OpenServer 6 Definitive
openssl OpenSSL 1.0.2rAa - OpenSSL Secure Socket Layer
oss724b OpenSSH update for SCO OpenServer 6 Definitive
extshells Extended Shells 1.5.0Cd - GNU bash Security Update
firefox Firefox 2.0.0.20Ba - Web Browser (19MB)
Xinuosc-ares c-ares 1.13.0a - Asyncronous resolver library
Xinuoslibssh2 libssh2 1.8.0b - SSH2 library
Xinuoscurl cURL 7.58.0 - Data transfer tool
xz xz 5.2.3b - XZ Utils
Xinuosdb53 db53 5.3.28 - Berkeley DB
Xinuoslibffi libffi 3.0.13 - Foreign Function Interface
Xinuosreadline readline 7.0p3a - GNU Readline library
Xinuostcl Tcl 8.5.15 - Tcl
Xinuoslibiconv libiconv 1.15b - GNU charset conversion
Xinuoslibxml2 libxml2 2.9.4b - XML2 library
Xinuosgettext gettext 0.19.8.1a - GNU Gettext
Xinuosgdbm gdbm 1.13 - GNU dbm
Xinuossqlite sqlite 3.20.1 - SQLite
Xinuostk Tk 8.5.15a - Tk
Xinuospython python 2.7.14 - Python
Xinuosgtar gtar 1.30 - GNU Tar
Xinuospcre pcre 8.42 - PCRE Perl-Compatible RegEx Library
Xinuoswget wget 1.20 - GNU Wget
ahci ahci 2.0a - SATA AHCI HBA DriverYou must have the following installed or newer versions:
sasl sasl 2.1.23Ca - Cyrus SASL API implementation
oss717b Berkeley-DB Database Library 4.6.21p4 update
oss719b Cyrus SASL API update for SCO OpenServer 6 Definitive
openssl OpenSSL 1.0.2rAa - OpenSSL Secure Socket Layer
Xinuosdb53 db53 5.3.28 - Berkeley DBNOTE:OpenSSL must be 1.0.2rAs or above.openssl ciphers -v | grep TLS # Shows your available TLS ciphersB. Verify sendmail support# /usr/lib/sendmail -d0.1 < /dev/nullYou will see something like the following:
# /usr/lib/sendmail -d0.1 < /dev/null
Version 8.13.8
Compiled with: DNSMAP LDAPMAP LDAP_REFERRALS LOG MAP_REGEX MATCHGECOS
MILTER MIME7TO8 MIME8TO7 NAMED_BIND NETINET NETUNIX NEWDB NIS
PIPELINING SASLv2 SCANF STARTTLS USERDB USE_LDAP_INIT XDEBUG============ SYSTEM IDENTITY (after readcf) ============
(short domain name) $w = mail
(canonical domain name) $j = mail.example.com
(subdomain name) $m = <null>
(node name) $k = mail
========================================================
Recipient names must be specifiedNOTE:You need SASLv2, STARTTLS* Newer unpublished versions of sendmail and other packages may be available to customers with a support contract.
See TA 127973:
TA 127973Step 2)Prepare, Create and install certificates.A. Decide if your going to have a public or private Certificate Authority (CA). A Certificate Authority (CA) (or Certification Authority) is an entity that issues digital certificates. The digital certificate certifies the ownership of a private or public key by the named subject of the certificate.
Digital certificates are issued by trusted parties for public certificates and are called certificate authorities, to verify the identity of an entity, such as a client or server. ... It is issued with an expiration date, after which it is no longer guaranteed by the certificate authority (CA).
Examples of public CA's are: Let's Encrypt, Comodo, Symantec, Digicert, GeoTrust. ...
NOTE:Skip to II if your going to use a public CA.
B. Private or Self Signed Certificate Authority (CA) you
need to become a certificate authority (CA). Becoming a
certificate authority means creating a special certificate
authority certificate, which asserts that you have the authority
to issue certificates for the CA.Example: Your e-mail server(s).I. Create a Certificate Authority (CA) as root:
NOTE: Use /etc for a CA for more than mail Use /etc/mail/ if all your doing is mail.
a. cd to /etc/
or
cd /etc/mail/
b. mkdir CA
c. cd CA/
d. mkdir certs crl newcerts private
e. chown root certs
f. chmod 0400 certs
g. echo "01" > serial
h. cp /dev/null index.txt
i. View /usr/lib/openssl/openssl.cnf
j. cp -p /usr/lib/openssl/openssl.cnf .NOTE: Edit file with your favorite editor example:
Although 4096 bits is slightly more secure than 2048 bits, it slows down TLS handshakes and significantly increases processor load during handshakes. For this reason, most servers use 2048-bit pairs.
k. vi openssl.cnfl. Find and edit this section:From:####################################################################
[ ca ]
default_ca = CA_default # The default ca section####################################################################
[ CA_default ]dir = ./demoCA # Where everything is kept
certs = $dir/certs # Where the issued certs are kept
crl_dir = $dir/crl # Where the issued crl are kept
database = $dir/index.txt # database index file.
#unique_subject = no # Set to 'no' to allow creation of
# several ctificates with same subject.
new_certs_dir = $dir/newcerts # default place for new certs.certificate = $dir/cacert.pem # The CA certificate
serial = $dir/serial # The current serial number
crlnumber = $dir/crlnumber # the current crl number
# must be commented out to leave a V1 CRL
crl = $dir/crl.pem # The current CRL
private_key = $dir/private/cakey.pem# The private key
RANDFILE = $dir/private/.rand # private random number filex509_extensions = usr_cert # The extentions to add to the cert# Comment out the following two lines for the "traditional"
# (and highly broken) format.
name_opt = ca_default # Subject Name options
cert_opt = ca_default # Certificate field optionsTo:####################################################################
[ ca ]
default_ca = CA_default # The default ca section####################################################################
[ CA_default ]dir = . # Where everything is kept
certs = $dir/certs # Where the issued certs are kept
crl_dir = $dir/crl # Where the issued crl are kept
database = $dir/index.txt # database index file.
#unique_subject = no # Set to 'no' to allow creation of
# several ctificates with same subject.
new_certs_dir = $dir/newcerts # default place for new certs.certificate = $dir/cacert.pem # The CA certificate
serial = $dir/serial # The current serial number
crlnumber = $dir/crlnumber # the current crl number
# must be commented out to leave a V1 CRL
crl = $dir/crl.pem # The current CRL
private_key = $dir/private/cakey.pem# The private key
RANDFILE = $dir/private/.rand # private random number filex509_extensions = usr_cert # The extentions to add to the cert# Comment out the following two lines for the "traditional"
# (and highly broken) format.
name_opt = ca_default # Subject Name options
cert_opt = ca_default # Certificate field optionsm. Find and edit this section:From:# A few difference way of specifying how similar the request should look
# For type CA, the listed attributes must be the same, and the optional
# and supplied fields are just that :-)
policy = policy_match# For the CA policy
[ policy_match ]
countryName = match
stateOrProvinceName = match
organizationName = match
organizationalUnitName = optional
commonName = supplied
emailAddress = optionalTo:
# A few difference way of specifying how similar the request should look
# For type CA, the listed attributes must be the same, and the optional
# and supplied fields are just that :-)
policy = policy_match# For the CA policy
[ policy_match ]
countryName = match
stateOrProvinceName = optional
organizationName = match
organizationalUnitName = match
commonName = optional
emailAddress = optionaln. Create you certificate authority (CA)openssl req -new -x509 -keyout private/cakey.pem -out cacert.pem \ -days 3650 -config openssl.cnf
The 3650 days creates a CA Key and Cert that is valid for 10 years.
Results:
# openssl req -new -x509 -keyout private/cakey.pem -out cacert.pem -days 3650 -config openssl.cnf
Generating a 1024 bit RSA private key
..++++++
.............................................................++++++
writing new private key to 'private/cakey.pem'
Enter PEM pass phrase:[Type pass phrase here]
Verifying - Enter PEM pass phrase:[Type pass phrase here]
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:US
State or Province Name (full name) [Some-State]:. [i.e., type a period]
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Whipple Certificate Authority
Organizational Unit Name (eg, section) []:
Common Name (eg, host/domain name) []:
Email Address []:NOTE:I intentionally omitted the Common Name, as I have noticed that commercial CA's generally don't have common names. Some SSL/TLS verification routines object to CA certificates that have common names.
If you want to see your new CA cert, issue this command:
openssl x509 -noout -text -in cacert.pemTo view the actual file:less cacert.pemo. Install your certificate authority (CA) filecp cacert.pem /etc/mail/certs/cacert.pemII. Prepare, Create or Generate and Issue TLS Certificates:
NOTE: Public CA's may have different requirements some require a Certificate Signing Request (CSR) see the Public CA:
Let's Encrypt see https://letsencrypt.org/See steps below to create a CSR:
i. Create a Certificate Signing Request (CSR) using OpenSSL:
A. Generate a rsa key:Without a Password$ openssl genrsa -out mail.yourdomain.com.key 2048With a Password$ openssl genrsa -des3 -out mail.yourdomain.com.key 2048To remove password from the above key$ openssl rsa -in mail.yourdomain.com.key \
-out mail.yourdomain.com.nopass.keyTo view/inspect the key you just created.
$ openssl rsa -in mail.yourdomain.com.key -noout -textTo extract the public key from the private key.
$ openssl rsa -in mail.yourdomain.com.key -pubout \
-out mail.yourdomain.com.pubkeyNOTE:The private key should never ever be sent or given to
anyone! Use only the public key. You use your private key
to prove you own it or to sign the Certificate Signing
Request (CSR).B. Generate a Certificate Request (CSR):A Certificate Signing Request can be sent to a Certificate Authority (CA) to obtain a Trusted Certificate.
When prompted, enter the necessary information for
creating the CSR by using the conventions: The following
characters cannot be used in the Organization Name or the
Organizational Unit: Characters between " ".
"< > ~ ! @ # $ % ^ * / \ ( ) ?.,&"Country) The two-letter ISO abbreviation for your country. Example: US
State or Province) The state or province where your organization is legally located. Do not use an abbreviation. Example: Utah
Locality Name) IT City or Locality, The city where your organization is legally located. Example: Salt Lake City
Organization Name) The exact legal name of your organization. Do not abbreviate your organization name. Example: Your Company, Inc.
Organizational Unit)
Section of the organization.
Example: yourdomain.comCommon Name)
The fully qualified domain name for your web server. This
must be an exact match. If you intend to secure the URL
https://www.yourdomain.com, then your CSR's common name
must be mail.yourdomain.com.
Example: mail.yourdomain.comEmail Address)
Address of responsible party.
Example: domain.admin@yourdomain.comWarning: Leave the challenge password blank (press Enter).
This is an example of the command and output from it.
$ openssl req -new -sha256 -key mail.yourdomain.com.key \
-out mail.yourdomain.com.csrYou will see something close to the following, you enter the information using the above guidelines:
You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank, For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [AU]: State or Province Name (full name) [Some-State]: Locality Name (eg, city) []: Organization Name (eg, company) [Internet Widgits Pty Ltd]: Organizational Unit Name (eg, section) []: Common Name (e.g. server FQDN or YOUR name) []: Email Address []:
Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []:
You may look at the contents of the Certificate Signing Request (CSR).
$ openssl req -in mail.yourdomain.com.csr -noout -textYou send the Certificate Signing Request (CSR) to whom ever you have generating your Certificate (CRT).
NOTE:Make sure Signature Algorithm is not MD5. Old OpenSSL configurations have default_md = md5. Modern Server's reject certificates that use md5 because of security with md5.
ii. Submit your Certificate Signing Request (CSR) to a CA or create an untrusted self-signed certificate:
A. To sign your CSR yourself using openssl:
req - We're generating a certificate -x509 - Create a SSL certificate following x509 specification -days 365 - The number of days a certificate is valid, 365 is one year -in mail.yourdomain.com.csr - CSR generated for certificate -key mail.yourdomain.com.key - Private Key used for certificate -out mail.yourdomain.com.crt - The new signed certificate file
$ openssl req -x509 -nodes -days 365 -in mail.yourdomain.com.csr \
-key mail.yourdomain.com.key -out mail.yourdomain.com.crtTo create a self-signed key and crt files together:
$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
-keyout mail.yourdomain.com.key -out mail.yourdomain.com.crtThese are not trusted, but can be used for testing. Copy them
into the default locations:cp mail.yourdomain.com.key /etc/mail/certs/sendmail.pem
cat mail.yourdomain.com.crt >> /etc/mail/certs/sendmail.pemB. Public CA's and Certificate Signing Request (CSR):
There are other Certificate Authorities that you can choose
to use. Having your certificate signed by a CA is required
if you want your keys to be trusted.iii. Install your Public or Private Certificate.
You will receive back from your CA some files in PEM format. Copy your files to the locations specified in:
/etc/mail/certs/The default locations are:Your CA goes in /etc/mail/certs/cacert.pemYour mail.example.com cert goes in /etc/mail/certs/sendmail.pemYour mail.example.com key goes in /etc/mail/certs/sendmail.pema. chown root /etc/mail/certs/*
b. chmod 0400 /etc/mail/certs/*Step 3)Using your favorite editor, open the macro configuration (mc)
file you use to generate your server's sendmail.cf. Edit
the .mc file for the OS:Example OpenServer 6 the file is /etc/mail/cf/cf/sco.osr6.mc and dd the following:
define(`confAUTH_OPTIONS',`A,p,y')dnl
define(`confTLS_SRV_OPTIONS', `V')dnl
define(`confCACERT_PATH', `/etc/mail/certs')dnl
define(`confCACERT', `/etc/mail/certs/cacert.pem')dnl
define(`confSERVER_CERT', `/etc/mail/certs/sendmail.pem')dnl
define(`confSERVER_KEY', `/etc/mail/certs/sendmail.pem')dnl
define(`confCLIENT_CERT', `/etc/mail/certs/sendmail.pem')dnl
define(`confCLIENT_KEY', `/etc/mail/certs/sendmail.pem')dnlLet's Encrypt Example Defines:define(`CERT_DIR', `/etc/letsencrypt/live/mail.example.com')
define(`confCACERT_PATH', `CERT_DIR')
define(`confCACERT', `CERT_DIR/cert.pem')
define(`confSERVER_CERT', `CERT_DIR/cert.pem')
define(`confSERVER_KEY', `CERT_DIR/privkey.pem')
define(`confCLIENT_CERT', `CERT_DIR/cert.pem')
define(`confCLIENT_KEY', `CERT_DIR/privkey.pem')NOTE:Here are some options you may want to use depending on the Sendmail version and needs:
DHParameters512
CipherList
ServerSSLOptions
ClientSSLOptionsdefine(`confDH_PARAMETERS', `/etc/mail/private/sendmail.dh.param')dnl
define(`confTLS_SRV_OPTIONS','SSL_OP_NO_TLS_v1 SSL_OP_NO_TLS_v1_1')Daemon Options:DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl
DAEMON_OPTIONS(`Port=smtps, Name=TLSMTA, M=s')dnl
DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnlVerify what ciphers are availble:openssl ciphers -vPossible submit.mc changes:define(`confPRIVACY_FLAGS', `noexpn,novrfy,noverb,needmailhelo,needvrfyhelo,nobodyreturn,,noetrn,restrictqrun')Step 4)Generate a new sendmail.cf using "mkdev cf" It will also restart sendmail.
Step 5)To test the connection with openssl use:
openssl s_client -starttls smtp -crlf -connect mail.example.com:587Results Self Signed:
# openssl s_client -starttls smtp -crlf -connect mail.example.com:587
CONNECTED(00000003)
depth=0 C = US, ST = Utah, L = Salt Lake City, O = Xinuos, CN = mail.example.com
verify return:1
depth=0 C = US, ST = Utah, L = Salt Lake City, O = Xinuos, CN = mail.example.com
verify return:1
---
Certificate chain 0 s:/C=US/ST=Utah/L=Salt Lake City/O=Xinuos/CN=mail.example.com
i:/C=US/ST=Utah/L=Salt Lake City/O=Xinuos/CN=mail.example.com
---
Server certificate
-----BEGIN CERTIFICATE-----MIIDvTCCAqWgAwIBAgIJALojbJpQg93EMA0GCSqGSIb3DQEBCwUAMHUxCzAJBgNV
BAYTAlVTMREwDwYDVQQIDAhOZXcgWW9yazERMA8GA1UEBwwITmV3IFlvcmsxGjAY
BgNVBAoMEUNvce48cmF0ZSBDb3VyaWVyMSQwIgYDVQQDDBtjY2k2LmNvcnBvcmF0
ZWNvdXJpZXJueS5jb20wHhcNMTkwNTMxMjIxNjAyWhcNMjQwNTI5MjIxNjAyWjB1
MQswCQYDVQQGEwJVUzERMA8GA1UECAwITmV3IFlvcmsxETAPBgNVBAcMCE5ldyBZ
b3JrMRowGAYDVQQKDBFDb3Jwb3JhdGUgQ291cmllcjEkMCIGA1UEAwwbY2NpNi5j
b3Jwb3JhdGVjb3VyaWVybnkuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEAoS04AvzAtuG6jtu/34stvLYukZi9LkAiBGfqNXNXCjVRCQfI7Ky00icZ
AYQuTaKJV6HwquIZvBWGTeVwSPNbPxPaFV/f2xmI3po/UQImiAibgUxmMJafb9U+
tFCJ1hMwxdawvKMvvXpKg4wepxy7MQyrhYeRZ57zJZt7UPqKA8t6c60Gv+wqn+BA
ezQbhIxEFKnGGYyaqZM6krC9AFZMIKPe1KebLEfmwbEpqOoi8zv3q2kPNTsr05QH
041ETqrgPDJHlkG+kPbXz3mZu+kQHBbr1m8zv5Zmj3JE5yGdG4vNlZxKtsZrSBDq
OICcF3NGSsBMTU+fUQWWqVxXpdnMhwID
-----END CERTIFICATE-----
CONNECTED(00000003)
depth=0 C = US, ST = Utah, L = Salt Lake City, O = Xinuos,
CN = mail.example.com
verify error:num=18:self signed certificate
verify return:1
depth=0 C = US, ST = Utah, L = Salt Lake City, O = Xinuos,
CN = mail.example.com
verify return:1
---
Certificate chain
0 s:/C=US/ST=Utah/L=Salt Lake City/O=Xinuos/CN=mail.example.com
i:/C=US/ST=Utah/L=Salt Lake City/O=Xinuos/CN=mail.example.com
---
Server certificate
-----BEGIN CERTIFICATE-----
MIIDvTCxweWgAwIBAgIJALojbJpQg93EMA0GCSqGSIb3DQEBCwUAMHUxCzAJBgNV
BAYTAlVTMREwDwYDVQQIDAhOZXcgWW9yazERMA8GA1UEBwwITmV3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VH9+Ro1u51TUjD7kp2iGW8VZdkulGIdALHLleEByOY63hvB6u9MdX4
9NloE8gIQtk3xVhylleh1j0VkvzYr9GZCdPpm1FMldZm3/A7qkh4kRuCqaob86VV
NQ==
-----END CERTIFICATE-----
subject=/C=US/ST=Utah/L=Salt Lake City/O=Xinuos/CN=mail.example.com
issuer=/C=US/ST=Utah/L=Salt Lake City/O=Xinuos/CN=mail.example.com
---
No client certificate CA names sent
Server Temp Key: DH, 512 bits
---
SSL handshake has read 1796 bytes and written 7 bytes
---
New, (NONE), Cipher is (NONE)
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
Protocol : TLSv1.2
Cipher : 0000
Session-ID:
Session-ID-ctx:
Master-Key:
Key-Arg : None
PSK identity: None
PSK identity hint: None
SRP username: None
Start Time: 1559341984
Timeout : 300 (sec)
Verify return code: 18 (self signed certificate)Results Let's Encrypt:openssl s_client -starttls smtp -crlf -connect mail.example.com:587
CONNECTED(00000003)
depth=2 O = Digital Signature Trust Co., CN = DST Root CA X3
verify return:1
depth=1 C = US, O = Let's Encrypt, CN = Let's Encrypt Authority X3
verify return:1
depth=0 CN = example.com
verify return:1
---
Certificate chain
0 s:/CN=example.com
i:/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
1 s:/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
i:/O=Digital Signature Trust Co./CN=DST Root CA X3
---
Server certificate
-----BEGIN CERTIFICATE-----
MIIFVjCCBD6gAwIBAgISAzXyKdkkvrHukm8SROMygnRyMA0GCSqGSIb3DQEBCwUA
MEoxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MSMwIQYDVQQD
ExpMZXQncyBFbmNyeXB0IEF1dGhvcml0eSBYMzAeFw0xOTA0MDIyMzE0NTBaFw0x
OTA3MDEyMzE0NTBaMBQxEjAQBgNVBAMTCXplbmV6LmNvbTCCASIwDQYJKoZIhvcN
A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bqqUPxYB9S3b79Yeily3KTDDPTlRUf0
eAAAAWngjGY4AAAEAwBHMEUCIQCyTuYWTMdJzvr9JEyN7aP1VVNApatRK99aJ6yG
tSZ7GAIgF7pPqjrByBYylvwcEqb/Lac7lqi8DAKjq0ui6ecgZOswDQYJKoZIhvcN
AQELBQADggEBAJOye81TdGY34GjddYv06tWOSvk/mQ68Xd5BMPjsoEMlYtLqpXdc
y1U5Ap6gc1w1yLzd9BmU9owC86+VqjX52G01LbGPhdA/0UHX/02Y0NRpn+dyqfSS
CiWtiGY7VOO4l+dsDDRw5zz2hHOzMYPKopUO/fN/6Oz4gNUuAKKwt9OI/+vRJLJu
hWVH5Gp/wL1JEidYGLsISYfzntJ534BPCizRVqgC76fDQoUJh/kZW6KMNS1AOWB/
XTBhiOWqqYUFGRobQMzWY2iQLdnIm7+/8UL29a/BrNyegAUWQnCIsnOBwZzetN3B
dDrbB6ORo08MmxmHqO7o6aefDI74gjXRl6A=
-----END CERTIFICATE-----
subject=/CN=example.com
issuer=/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
---
No client certificate CA names sent
Client Certificate Types: RSA sign, DSA sign, ECDSA sign
Requested Signature Algorithms: RSA+SHA512:DSA+SHA512:ECDSA+SHA512:RSA+SHA384:DSA+SHA384:ECDSA+SHA384:RSA+SHA256:DSA+SHA256:ECDSA+SHA256:RSA+SHA224:DSA+SHA224:ECDSA+SHA224:RSA+SHA1:DSA+SHA1:ECDSA+SHA1
Shared Requested Signature Algorithms: RSA+SHA512:DSA+SHA512:ECDSA+SHA512:RSA+SHA384:DSA+SHA384:ECDSA+SHA384:RSA+SHA256:DSA+SHA256:ECDSA+SHA256:RSA+SHA224:DSA+SHA224:ECDSA+SHA224:RSA+SHA1:DSA+SHA1:ECDSA+SHA1
Peer signing digest: SHA512
Server Temp Key: ECDH, P-256, 256 bits
---
SSL handshake has read 3445 bytes and written 347 bytes
Verification: OK
---
New, TLSv1.2, Cipher is ECDHE-RSA-AES256-GCM-SHA384
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
Protocol : TLSv1.2
Cipher : ECDHE-RSA-AES256-GCM-SHA384
Session-ID: F07B4AC137873EE6B13CA1D5A9C18E9D1FBE4F8741CA799BCC5B3DC9838E5F17
Session-ID-ctx:
Master-Key: 546211398A1344F75E26870A05D67634EF0D0DADDFD787841D1F29F463C576EEA74FB636B2E2C8EA806F81FCF5067753
PSK identity: None
PSK identity hint: None
SRP username: None
TLS session ticket lifetime hint: 7200 (seconds)
TLS session ticket:
0000 - 7b 84 e6 37 a8 7f 04 3c-d3 24 16 b4 b6 0a be ab {..7...<.$......
0010 - 22 a9 2d 75 97 f3 0b 67-16 50 c9 2f a6 eb 92 3f ".-u...g.P./...?
0020 - 1b 11 5b fb 81 71 78 4e-67 ae 4b 3c 67 58 3a 4b ..[..qxNg.K<gX:K
0030 - 4f fa ff 66 b4 8b 9d 00-1a e1 b8 fb 92 8f 75 fe O..f..........u.
0040 - 7b da 3b 7d 5a f6 ba 5d-7c 18 cd b8 ad c3 9a 2b {.;}Z..]|......+
0050 - 75 b4 1e 49 5a bc ae 81-f4 07 86 c0 1c 80 d4 b7 u..IZ...........
0060 - 14 d3 10 ce 15 62 02 b6-6b 51 41 44 8a ef fb b8 .....b..kQAD....
0070 - c2 aa 3c 6a f1 b7 e4 17-12 6d 56 0d 0a 98 1a a1 ..<j.....mV.....
0080 - 8e 66 d2 f3 b2 c3 9b ed-cd 71 08 1f eb 67 6b 60 .f.......q...gk`
0090 - ce 23 04 ad 3d 7c 16 46-47 61 62 f6 90 ba 9c aa .#..=|.FGab..... Start Time: 1559400542
Timeout : 7200 (sec)
Verify return code: 0 (ok)
Extended master secret: no
---
250 DSN
quit
221 2.0.0 Bye
closed---NOTE:Privacy Enhanced Mail (PEM) is a Base64 encoded DER certificate. It contains very distinct headers and footers.
The header and footer identifies the type of file, not all PEM files are necessarily needed.
-----BEGIN CERTIFICATE REQUEST----- and -----END CERTIFICATE REQUEST----- a CSR in PEM format.
-----BEGIN RSA PRIVATE KEY----- and -----END RSA PRIVATE KEY----- a private key in PEM format.
-----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- a certificate file in PEM format.
Below is a example of a Certificate in PEM format:
The header and footer identifies the type of file, not all PEM files are necessarily needed.
-----BEGIN CERTIFICATE REQUEST----- and -----END CERTIFICATE REQUEST----- a CSR in PEM format.
-----BEGIN RSA PRIVATE KEY----- and -----END RSA PRIVATE KEY----- a private key in PEM format.
-----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- a certificate file in PEM format.
Below is a example of a Certificate in PEM format:
-----BEGIN CERTIFICATE----- miIDxDCCAqwCCQC8Is5uuYnOpjANBgkqhkiG9w0BAQQFADCBozELMAkGA1UEBhMC vsMxDTALBgNVBAgTBFV0YWgxGDAWBgNVBAcTD05vcnRoIFNhbHQgTGFrZTEZMBcG a1UEChMQTHluIERpc3RyaWJ1dGluZzEUMBIGA1UECxMLTWFpbiBPZmZpY2UxGDAW bgNVBAMTD3Bicy5seW5kaXN0LmNvbTEgMB4GCSqGSIb3DQEJARYRc2FsZXNAbHlu ZGlzdC5jb20wHhcNMTgxneE4MjIwNDE5WhcNMjgxMDE1MjIwNDE5WjCBozELMAkG A1UEBhMCVVMxDTALBgNVBAgTBFV0YWgxGDAWBgNVBAcTD05vcnRoIFNhbHQgTGFr ZTEZMBcGA1UEChMQTHluIERpc3RyaWJ1dGluZzEUMBIGA1UECxMLTWFpbiBPZmZp Y2UxGDAWBgNVBAMTD3Bicy5seW5kaXN0LmNvbTEgMB4GCSqGSIb3DQEJARYRc2Fs zxnAbHluZGlzdC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDP hAOn3hJ7HBJQWBwrUFiYGW5f0EdWPzcZBj/ZjJ5uFq2O9aF5Cd+9FC0NUsN1Z/5u Z+OL7QQrZmAsmt1Ealkmln85XL7AO/vk60R5W5gqmOjymRPAImrZdzjcG+Dg8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