I have applied certificates for mydomain(www.mydomain.top) by this:
#docker run -it --rm --name certbot -v "/etc/letsencrypt:/etc/letsencrypt" -v "/var/lib/letsencrypt:/var/lib/letsencrypt" -p 80:80 certbot/certbot certonly
1.And I copied fullchain.pem,privkey.pem into directory
#cp fullchain.pem /etc/ssl/certs/fullchain.pem
#cp privkey.pem /etc/ssl/private/privkey.pem
#cp fullchain.pem /etc/ssl/certs/fullchain.pem
2.After that I edited the apache configuration default-ssl.conf:
ServerName www.mydomain.top
SSLEngine on
SSLCertificateFile /etc/ssl/certs/fullchain.pem
SSLCertificateKeyFile /etc/ssl/private/privkey.pem
SSLCACertificatePath /etc/ssl/certs/
SSLCACertificateFile /etc/ssl/certs/fullchain.pem
3.Start apache2:
#service apache2 start
4.Test ssl
echo |openssl s_client -connect www.iotsecurity.top:8443
CONNECTED(00000003)
depth=3 O = Digital Signature Trust Co., CN = DST Root CA X3
verify return:1
depth=2 C = US, O = Internet Security Research Group, CN = ISRG Root X1
verify return:1
depth=1 C = US, O = Let's Encrypt, CN = R3
verify return:1
depth=0 CN = www.iotsecurity.top
verify return:1
---
Certificate chain
0 s:/CN=www.iotsecurity.top
i:/C=US/O=Let's Encrypt/CN=R3
1 s:/C=US/O=Let's Encrypt/CN=R3
i:/C=US/O=Internet Security Research Group/CN=ISRG Root X1
2 s:/C=US/O=Internet Security Research Group/CN=ISRG Root X1
i:/O=Digital Signature Trust Co./CN=DST Root CA X3
3 s:/O=Digital Signature Trust Co./CN=DST Root CA X3
i:/O=Digital Signature Trust Co./CN=DST Root CA X3
---
Server certificate
-----BEGIN CERTIFICATE-----
MIIFKzCCBBOgAwIBAgISA7LH5Kn5af+bt8FJN9Z4Yfm/MA0GCSqGSIb3DQEBCwUA
MDIxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MQswCQYDVQQD
EwJSMzAeFw0yMTA4MjUwMjE5NDdaFw0yMTExMjMwMjE5NDZaMB4xHDAaBgNVBAMT
E3d3dy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D2XJQv0XcwIhRUGAgwlFaO400TGTO/3wwv
IAvMTvFk4wAAAXt7Uiv2AAAEAwBGMEQCIDblS6b/Mf/Lqicfgh9QpwdILLbXnL7/
c24w1abwQllZAiA0E1t+mlpxPyyG4fVgchQhnhAP7w/JtGGSNdRxr4DndzANBgkq
hkiG9w0BAQsFAAOCAQEAP69EnX4foYktBhZYO9ohbkt/FQAmocerw7hthoasJy/f
8ry3/onxzbdbo+bSXxOF/rp8zArBJWF+N67AFmReMO7bGArz7Ip1y62pIFO9ISZ3
xUAsgGOVYu24CIrQHU1dzVy98G4PLBMB8bjujqz035citcJ9t6RY9FG3/1x1uZB9
QZbdfaQ7tticBf1GMxFZJ08oLRTE3tZJlpzzuQYErz0bfqpfcV7KF2G4xfKTAQBL
NKwcaxdjAQyqzz3m5Kx+f0Zr4muKxKVu22HJKtiJcsMWisWZMkm9uijcMlHPAoeU
txy4LVTdXMyud7ohzPCQ4SMj+RuuFKrJuVSVttiC9A==
-----END CERTIFICATE-----
subject=/CN=www.iotsecurity.top
issuer=/C=US/O=Let's Encrypt/CN=R3
---
No client certificate CA names sent
Peer signing digest: SHA512
Server Temp Key: ECDH, P-256, 256 bits
---
SSL handshake has read 5559 bytes and written 415 bytes
---
New, TLSv1/SSLv3, 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: B6F4413B4B7F5397FCC16E657DD6BD2B8F6C144AB6C1D6029BC944C6D3DAC918
Session-ID-ctx:
Master-Key: F2B8D2F678DF60A62A8FBB199333B20D7CF096F791131F466C3403738294CA89E49A6F8A584B276D6645F955BC64D390
Key-Arg : None
Krb5 Principal: None
PSK identity: None
PSK identity hint: None
TLS session ticket lifetime hint: 300 (seconds)
TLS session ticket:
0000 - 13 5e d2 2e c5 e5 2a 95-a8 a9 6b 4c 7e 32 4b 2d .^....*...kL~2K-
0010 - 7a 1f 48 d9 4a be 9c 07-e7 e7 66 99 37 d7 a6 d5 z.H.J.....f.7...
0020 - 66 fc 25 5a 0e dd b7 e0-64 62 0b 66 38 4a 1a 27 f.%Z....db.f8J.'
0030 - 3c 4c 4f 9b ae 06 ac 69-a0 1d 48 b8 73 17 e3 93 <LO....i..H.s...
0040 - 74 3c 3d c9 3e b0 49 a5-db 10 43 15 5a 5b 85 1c t<=.>.I...C.Z[..
0050 - a2 f6 73 1d 84 02 0f 7c-28 12 2f 6b b8 f0 05 1e ..s....|(./k....
0060 - 54 52 89 df cb f4 bc d1-c3 ef 12 47 90 9f 98 27 TR.........G...'
0070 - b4 58 b2 4e 20 22 df 94-8a a4 c3 be e4 80 0a ed .X.N "..........
0080 - 46 83 11 52 ca ff 57 af-07 6f 4d eb cd ec 02 30 F..R..W..oM....0
0090 - 10 9b 1d f7 d5 1f 91 9b-49 76 08 e4 a1 4b 20 87 ........Iv...K .
00a0 - 80 74 cb a8 cd 8a e1 b5-38 c5 84 3b 08 dd d3 fd .t......8..;....
00b0 - b4 26 40 42 1c 5d c2 f8-60 21 dd 63 65 ff 62 6a .&@B.]..`!.ce.bj
Start Time: 1629946744
Timeout : 300 (sec)
Verify return code: 0 (ok)
DONE
5.Test connection by another machine:
# curl https://www.mydomain.top:8443/list_score.php
curl: (35) TCP connection reset by peer
[root@mitu-bsdt ~]# curl -v https://www.mydomain.top:8443/list_score.php
* About to connect() to www.mydomain.top port 8443 (#0)
* Trying x.x.179.163...
* Connected to www.mydomain.top (x.x.179.163) port 8443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
* NSS error -5961 (PR_CONNECT_RESET_ERROR)
* TCP connection reset by peer
* Closing connection 0
curl: (35) TCP connection reset by peer
6.Test connection by Windows 10:
>curl -v https://www.mydomain.top:8443
* Rebuilt URL to: https://www.mydomain.top:8443/
* Trying x.x.179.163...
* TCP_NODELAY set
* Connected to www.iotsecurity.top (x.x.179.163) port 8443 (#0)
* schannel: SSL/TLS connection with www.mydomain.top port 8443 (step 1/3)
* schannel: checking server certificate revocation
* schannel: sending initial handshake data: sending 190 bytes...
* schannel: sent initial handshake data: sent 190 bytes
* schannel: SSL/TLS connection with www.mydomain.top port 8443 (step 2/3)
* schannel: failed to receive handshake, need more data
* schannel: SSL/TLS connection with www.mydomain.top port 8443 (step 2/3)
* schannel: failed to receive handshake, SSL/TLS connection failed
* Closing connection 0
* schannel: shutting down SSL/TLS connection with www.mydomain.top port 8443
* Send failure: Connection was reset
* schannel: failed to send close msg: Failed sending data to the peer (bytes written: -1)
* schannel: clear security context handle
curl: (35) schannel: failed to receive handshake, SSL/TLS connection failed