一、简介

s_client为一个SSL/TLS客户端程序,与s_server对应,它不仅能与s_server进行通信,也能与任何使用ssl协议的其他服务程序进行通信

二、语法

openssl s_client [-host host] [-port port] [-connect host:port] [-verify depth] [-cert filename] [-certform DER|PEM] [-key filename] [-keyform DER|PEM] [-pass arg] [-CApath directory] [-CAfile filename] [-reconnect][-pause] [-showcerts] [-debug] [-msg] [-state] [-nbio_test] [-nbio][-crlf] [-ign_eof] [-no_ign_eof] [-quiet] [-ssl2] [-ssl3] [-tls1_1] [-tls1_2] [-tls1] [-dtls1] [-no_ssl2][-no_ssl3] [-no_tls1] [-no_tls1_1] [-no_tls1_2] [-bugs] [-cipher cipherlist] [-starttls protocol] [-engine id] [-tlsextdebug] [-no_ticket] [-sess_out filename] [-sess_in filename] [-rand file(s)]

选项

-host host     - use -connect instead
-port port - use -connect instead
-connect host:port - who to connect to (default is localhost:)
-verify arg - 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
-trusted_first - Use trusted CA's first when building the trust chain
-reconnect - Drop and re-make the connection with the same Session-ID
-pause - sleep() after each read() and write() 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)
-no_ign_eof - don't ignore input eof
-psk_identity arg - PSK identity
-psk arg - PSK in hex (without 0x)
-ssl2 - just use SSLv2
-ssl3 - just use SSLv3
-tls1_2 - just use TLSv1.
-tls1_1 - just use TLSv1.
-tls1 - just use TLSv1
-dtls1 - just use DTLSv1
-mtu - set the link layer MTU
-no_tls1_2/-no_tls1_1/-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", "ftp" and "xmpp"
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
-servername host - Set TLS extension servername in ClientHello
-tlsextdebug - hex dump of all TLS extensions received
-status - request certificate status from server
-no_ticket - disable use of RFC4507bis session tickets
-nextprotoneg arg - enable NPN extension, considering named protocols supported (comma-separated list)
-legacy_renegotiation - enable use of legacy renegotiation (dangerous)
-use_srtp profiles - Offer SRTP key management with a colon-separated profile list
-keymatexport label - Export keying material using label
-keymatexportlen len - Export len bytes of keying material (default )

三、实例

1、连接s_server服务(站点证书及私钥,证书链,协议版本,算法组合)

openssl s_client -connect localhost: -key clientprikey.pem -cert client.pem -ssl3 -cipher EXP-KRB5-RC4-MD5 -msg -debug

最新文章

  1. CSS知识总结(八)
  2. java文件读写操作大全
  3. Android百分比布局支持库介绍——com.android.support:percent(转)
  4. HIVE几种数据导入方式
  5. Java调用JavaScript
  6. window.parent ,window.top,window.self 详解
  7. iis 500 解决方法
  8. Sprite Kit教程:制作一个通用程序 2
  9. 屏蔽webbrowser控件右键的一种方法
  10. kotlin 语言入门指南(三)--编码习惯
  11. 基于zookeeper实现分布式锁
  12. ImCash:韩国最大交易所遭遇至暗时刻:2018年亏损1.8亿美元
  13. 如何给localStorage设置一个过期时间?
  14. js +与?优先级
  15. Centos7部署kubernetes测试k8s应用(九)
  16. linux 内核开发环境搭建
  17. <转>字节码指令
  18. unity------------------------------transform.forward与Vector.forward的区别
  19. 利用SimpleDateFormat进行时间的跨时区转换 - Java
  20. JavaScript Event Delegation, and event.target vs. event.currentTarget

热门文章

  1. spring装载配置文件失败报错:org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException
  2. mysql设置合适的索引长度
  3. emacs之开始就加载tag
  4. TMS320C6657双核DSP的图像处理系统开发(1):硬件相关tips
  5. 【转】jMeter入门实例
  6. ActiveMQ入门之四--ActiveMQ持久化方式
  7. py基础2--列表,元祖,字典,集合,文件
  8. 第七章 Rolling update
  9. 使用poi读写Excel------demo
  10. 使用product_user_profile来实现用户权限的设定