我正在尝试使用openssl(Windows平台)来远程访问我的gmail并将示例电子邮件发送到任何其他任意电子邮件地址。我正在阅读https://easyengine.io/tutorials/mail/server/testing/smtp/上的手册,但是我甚至陷入了第一步。尝试执行命令时
OpenSSL> s_client -starttls smtp -connect gmail.com:25
我遇到如下错误
OpenSSL> s_client -starttls smtp -connect gmail.com:25 4792:错误:0200274C:系统库:连接:原因(1868):crypto \ bio \ b_sock2.c:110: 4792:错误:2008A067:BIO例程:BIO_connect:连接错误:crypto \ bio \ b_sock2.c:111: connect:errno = 0 s_client中的错误
尝试连接端口465,587时,我也收到类似的错误。您能帮我吗?
答案 0 :(得分:0)
您需要连接到正确的子域
smtp.gmail.com
端口25 smtp.gmail.com
端口465 smtp.gmail.com
端口587 这是工作连接的完整示例。
openssl s_client -starttls smtp -connect smtp.gmail.com:25
CONNECTED(00000003)
depth=2 OU = GlobalSign Root CA - R2, O = GlobalSign, CN = GlobalSign
verify return:1
depth=1 C = US, O = Google Trust Services, CN = Google Internet Authority G3
verify return:1
depth=0 C = US, ST = California, L = Mountain View, O = Google LLC, CN = smtp.gmail.com
verify return:1
---
Certificate chain
0 s:C = US, ST = California, L = Mountain View, O = Google LLC, CN = smtp.gmail.com
i:C = US, O = Google Trust Services, CN = Google Internet Authority G3
1 s:C = US, O = Google Trust Services, CN = Google Internet Authority G3
i:OU = GlobalSign Root CA - R2, O = GlobalSign, CN = GlobalSign
---
Server certificate
-----BEGIN CERTIFICATE-----
MIIEijCCA3KgAwIBAgIQCDR7oximRSyLCyil6DGdYzANBgkqhkiG9w0BAQsFADBU
MQswCQYDVQQGEwJVUzEeMBwGA1UEChMVR29vZ2xlIFRydXN0IFNlcnZpY2VzMSUw
IwYDVQQDExxHb29nbGUgSW50ZXJuZXQgQXV0aG9yaXR5IEczMB4XDTE5MDUxNDEz
MzQ0OVoXDTE5MDgwNjEzMjAwMFowaDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNh
bGlmb3JuaWExFjAUBgNVBAcMDU1v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LECZrtbNh6
g7mpedNO8gGSbkv36MqgKw1AKTkq1Aqzd3rHs8+I11WnGeniK73YivZ4t9Ea+v2R
hB6w8DwXt5M/rcawi+mkcCyUR8L2Biozy5yDGZGI3zMuc+X/kfyZLwfP3O27rYu8
qV7LgaTIJ2YKDsPAfDhuBSkZXq4+OQXvaVSUYbNid7BeDpwSJ+yRpkHhRILZ1dU1
mDNtAnk3UuzWjaKyfUk=
-----END CERTIFICATE-----
subject=C = US, ST = California, L = Mountain View, O = Google LLC, CN = smtp.gmail.com
issuer=C = US, O = Google Trust Services, CN = Google Internet Authority G3
---
No client certificate CA names sent
Peer signing digest: SHA256
Peer signature type: RSA-PSS
Server Temp Key: X25519, 253 bits
---
SSL handshake has read 3035 bytes and written 429 bytes
Verification: OK
---
New, TLSv1.3, Cipher is TLS_AES_256_GCM_SHA384
Server public key is 2048 bit
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 0 (ok)
---
250 SMTPUTF8