OpenSSL 윈도우 설치 smtp 접속
openssl-0.9.8h-1-bin.zip 다운로드
bin 폴더안의 openssl.exe, libssl32.dll, libeay32.dll 파일 필요
libeay32.dll, libssl32.dll파일을 윈도우 system32폴더에 복사.
;openssl.exe 실행
genrsa -des3 -out private.pem 2048
;Enter pass phrase for private.pem:(여기에 패스워드 넣어야함)
;Verifying - Enter pass phrase for private.pem:(여기에 패스워드 넣어야함)
rsa -in private.pem -outform PEM -pubout -out public.pem
;private.pem, public.pem 2개가 생성되었다.
사용법 ================================================ OpenSSL> s_client /? unknown option /? usage: s_client args -host host - use -connect instead -port port - use -connect instead -connect host:port - who to connect to (default is localhost:4433) -verify depth - turn on peer certificate verification -cert arg - certificate file to use, PEM format assumed -certform arg - certificate format (PEM or DER) PEM default -key arg - Private key file to use, in cert file if not specified but cert file is. -keyform arg - key format (PEM or DER) PEM default -pass arg - private key file pass phrase source -CApath arg - PEM format directory of CA's -CAfile arg - PEM format file of CA's -reconnect - Drop and re-make the connection with the same Session-ID -pause - sleep(1) after each read(2) and write(2) system call -showcerts - show all certificates in the chain -debug - extra output -msg - Show protocol messages -nbio_test - more ssl protocol testing -state - print the 'ssl' states -nbio - Run with non-blocking IO -crlf - convert LF from terminal into CRLF -quiet - no s_client output -ign_eof - ignore input eof (default when -quiet) -ssl2 - just use SSLv2 -ssl3 - just use SSLv3 -tls1 - just use TLSv1 -dtls1 - just use DTLSv1 -mtu - set the MTU -no_tls1/-no_ssl3/-no_ssl2 - turn off that protocol -bugs - Switch on all SSL implementation bug workarounds -serverpref - Use server's cipher preferences (only SSLv2) -cipher - preferred cipher to use, use the 'openssl ciphers' command to see what is available -starttls prot - use the STARTTLS command before starting TLS for those protocols that support it, where 'prot' defines which one to assume. Currently, only "smtp", "pop3", "imap", and "ftp" are supported. -engine id - Initialise and use the specified engine -rand file;file;... -sess_out arg - file to write SSL session to -sess_in arg - file to read SSL session from error in s_client OpenSSL> |
s_client -connect smtp.naver.com:465
s_client -reconnect smtp.naver.com:465
s_client -host smtp.naver.com -port 465
;안된다. 계속 아래의 에러 발생.
;connect: Bad file descriptor
;connect:errno=10061
s_client -host smtp.naver.com -port 465 -ign_eof
;-ign_eof 옵션은 접속을 유지하라는 말
;접속 성공
---
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA
Server public key is 2048 bit
Compression: NONE
Expansion: NONE
SSL-Session:
Protocol : TLSv1
Cipher : DHE-RSA-AES256-SHA
Session-ID: A23B0F6B1142075FF959C33AA16E413197349BB33BD6A2BE86F7ECE94D9E
Session-ID-ctx:
Master-Key: A37DB08649235496E8221E53AFA407B480466DD864CF1D251762AF6FD43D4EA0A5149AC7FE
Key-Arg : None
Start Time: 1568894696
Timeout : 300 (sec)
Verify return code: 19 (self signed certificate in certificate chain)
---
220 smtp.naver.com ESMTP eog36M17QNCpgIv1O1wabQ - nsmtp
;여기에 smtp 명령을 넣으면 된다.