设置 cipher suite
https://man.openbsd.org/SSL_CTX_set_cipher_list.3#ECDHE
SSL_CTX_set_cipher_list() sets the list of available cipher suites for ctx using the control string. The list of cipher suites is inherited by all ssl objects created from ctx.
SSL_set_cipher_list() sets the list of cipher suites only for ssl.
The control string consists of one or more control words separated by colon characters (‘:’). Space (‘ ’), semicolon (‘;’), and comma (‘,’) characters can also be used as separators. Each control words selects a set of cipher suites and can take one of the following optional prefix characters:
- No prefix:
- Those of the selected cipher suites that have not been made available yet are added to the end of the list of available cipher suites, preserving their order.
- Prefixed minus sign (‘
-’): - Those of the selected cipher suites that have been made available earlier are moved back from the list of available cipher suites to the beginning of the list of unavailable cipher suites, also preserving their order.
- Prefixed plus sign (‘
+’): - Those of the selected cipher suites have been made available earlier are moved to end of the list of available cipher suites, reducing their priority, but preserving the order among themselves.
- Prefixed exclamation mark (‘
!’): - The selected cipher suites are permanently deleted, no matter whether they had earlier been made available or not, and can no longer be added or re-added by later words.
The following special words can only be used without a prefix:
DEFAULT- An alias for
ALL:!aNULL:!eNULL. It can only be used as the first word. @STRENGTH- Sort the list by decreasing encryption strength, preserving the order of cipher suites that have the same strength. It is usally given as the last word.
The following words can be used to select groups of cipher suites, with or without a prefix character. If two or more of these words are joined with plus signs (‘+’) to form a longer word, only the intersection of the specified sets is selected.
ADH- Cipher suites using ephemeral DH for key exchange without doing any server authentication. Equivalent to
kEDH+aNULL. aDSS- Cipher suites using DSS server authentication. LibreSSL does not provide any such cipher suites.
AEAD- Cipher suites using Authenticated Encryption with Additional Data.
AECDH- Cipher suites using ephemeral ECDH for key exchange without doing any server authentication. Equivalent to
kEECDH+aNULL. aECDSA- Cipher suites using ECDSA server authentication.
AES- Cipher suites using AES or AESGCM for symmetric encryption.
AES128- Cipher suites using AES(128) or AESGCM(128) for symmetric encryption.
AES256- Cipher suites using AES(256) or AESGCM(256) for symmetric encryption.
AESGCM- Cipher suites using AESGCM for symmetric encryption.
aGOST- An alias for
aGOST01. aGOST01- Cipher suites using GOST R 34.10-2001 server authentication.
ALL- All cipher suites except those selected by
eNULL. aNULL- Cipher suites that don't do any server authentication. Not enabled by
DEFAULT. Beware of man-in-the-middle attacks. aRSA- Cipher suites using RSA server authentication.
CAMELLIA- Cipher suites using Camellia for symmetric encryption.
CAMELLIA128- Cipher suites using Camellia(128) for symmetric encryption.
CAMELLIA256- Cipher suites using Camellia(256) for symmetric encryption.
CHACHA20- Cipher suites using ChaCha20-Poly1305 for symmetric encryption.
COMPLEMENTOFALL- Cipher suites that are not included in
ALL. Currently an alias foreNULL. COMPLEMENTOFDEFAULT- Cipher suites that are included in
ALL, but not included inDEFAULT. Currently similar toaNULL:!eNULLexcept for the order of the cipher suites which are not selected. DES- Cipher suites using single DES for symmetric encryption.
3DES- Cipher suites using triple DES for symmetric encryption.
DH- An alias for
kEDH. DHE- Cipher suites using ephemeral DH for key exchange, but excluding those that don't do any server authentication. Similar to
kEDH:!aNULLexcept for the order of the cipher suites which are not selected. DSS- An alias for
aDSS. ECDH- An alias for
kEECHD. ECDHE- Cipher suites using ephemeral ECDH for key exchange, but excluding those that don't do any server authentication. Similar to
kEECDH:!aNULLexcept for the order of the cipher suites which are not selected. ECDSA- An alias for
aECDSA. EDH- An alias for
DHE. EECHD- An alias for
ECDHE. eNULL- Cipher suites that do not use any encryption. Not enabled by
DEFAULT, and not even included inALL. GOST89MAC- Cipher suites using GOST 28147-89 for message authentication instead of HMAC.
GOST94- Cipher suites using HMAC based on GOST R 34.11-94 for message authentication.
HIGH- Cipher suites of high strength. Currently, these are cipher suites using
CHACHA20,AES,CAMELLIA, or GOST-28178-89-CNT symmetric encryption. IDEA- Cipher suites using IDEA for symmetric encryption. LibreSSL does not provide any such cipher suites.
kEDH- Cipher suites using ephemeral DH for key exchange.
kEECDH- Cipher suites using ephemeral ECDH for key exchange.
kGOST- Cipher suites using VKO 34.10 key exchange, specified in RFC 4357.
kRSA- Cipher suites using RSA key exchange.
LOW- Cipher suites of low strength. Currently, these are cipher suites using
DESorRC4symmetric encryption. MD5- Cipher suites using MD5 for message authentication.
MEDIUM- Cipher suites of medium strength. Currently, these are cipher suites using
3DESsymmetric encryption. NULL- An alias for
eNULL. RC4- Cipher suites using RC4 for symmetric encryption.
RSA- Cipher suites using RSA for both key exchange and server authentication. Equivalent to
kRSA+aRSA. SHA- An alias for
SHA1. SHA1- Cipher suites using SHA1 for message authentication.
SHA256- Cipher suites using SHA256 for message authentication.
SHA384- Cipher suites using SHA384 for message authentication.
SSLv3- An alias for
TLSv1. STREEBOG256- Cipher suites using STREEBOG256 for message authentication.
TLSv1- Cipher suites usable with any TLS protocol.
TLSv1.2- Cipher suites for the TLSv1.2 protocol.
The full words returned by the openssl(1) ciphers command can be used to select individual cipher suites.
Unknown words are silently ignored, selecting no cipher suites. Failure is only flagged if the control string contains invalid bytes or if no matching cipher suites are available at all.
On the client side, including a cipher suite into the list of available cipher suites is sufficient for using it. On the server side, all cipher suites have additional requirements. ADH ciphers don't need a certificate, but DH-parameters must have been set. All other cipher suites need a corresponding certificate and key.
A RSA cipher can only be chosen when an RSA certificate is available. RSA ciphers using DHE need a certificate and key and additional DH-parameters (see SSL_CTX_set_tmp_dh_callback(3)).
A DSA cipher can only be chosen when a DSA certificate is available. DSA ciphers always use DH key exchange and therefore need DH-parameters (see SSL_CTX_set_tmp_dh_callback(3)).
When these conditions are not met for any cipher suite in the list (for example, a client only supports export RSA ciphers with an asymmetric key length of 512 bits and the server is not configured to use temporary RSA keys), the “no shared cipher” (SSL_R_NO_SHARED_CIPHER) error is generated and the handshake will fail.
设置 cipher suite的更多相关文章
- 查看现有的 cipher suite
openssl ciphers [-v] [-ssl2] [-ssl3] [-tls1] [cipherlist]
- testng执行多个suite
由于testng.xml中只能设置一个<suite>标签,就无法创建多个测试集,通过<suite-files >标签可以实现允许多个测试集. 1.testng.xml中引入多个 ...
- Burp Suite的使用介绍
在网上找了一篇关于Burp Suite的使用介绍,感觉写的基础的,下面就copy了,另外还有一篇<BurpSuite实战指南>的pdf是一位好心的“前辈”共享的https://www.gi ...
- HTTPS 互联网世界的安全基础
近一年公司在努力推进全站的 HTTPS 化,作为负责应用系统的我们,在配合这个趋势的过程中,顺便也就想去搞清楚 HTTP 后面的这个 S 到底是个什么含义?有什么作用?带来了哪些影响?毕竟以前也就只是 ...
- https连接的前几毫秒发生了什么
在讨论这个话题之前,先提几个问题: 为什么说https是安全的,安全在哪里? https是使用了证书保证它的安全的么? 为什么证书需要购买? 我们先来看https要解决什么问题 (手机读者推荐移步ht ...
- HTTPS 原理解析
一 前言 在说HTTPS之前先说说什么是HTTP,HTTP就是我们平时浏览网页时候使用的一种协议.HTTP协议传输的数据都是未加密的,也就是明文的,因此使用HTTP协议传输隐私信息非常不安全.为了保证 ...
- HTTP 2.0的那些事
转自:http://www.admin10000.com/document/9310.html 在我们所处的互联网世界中,HTTP协议算得上是使用最广泛的网络协议.最近http2.0的诞生使得它再次互 ...
- http2协议翻译(转)
超文本传输协议版本 2 IETF HTTP2草案(draft-ietf-httpbis-http2-13) 摘要 本规范描述了一种优化的超文本传输协议(HTTP).HTTP/2通过引进报头字段压缩以及 ...
- iOS安全笔记
这一篇文章, 加上里面链接的几篇文章(一个百度的, 两个阮一峰的), 全看完应该了解得差不多了 如何打造一个安全的App?这是每一个移动开发者必须面对的问题.在移动App开发领域,开发工程师对于安全方 ...
随机推荐
- 总结:自动将函数对象添加到字典的bug
介绍 本文以ATM项目为背景,介绍一个比较实用的编程技巧,使用装饰器将项目中的指定函数添加到字典中. 利用字典通过key访问value的特点,实现用户输入编号,通过字典直接获取并调用编号对应的功能函数 ...
- 2020非常全的软件测试linux常用命令全集,linux面试题及参考答案
一.前言: 作为一名软件测试工程师,我相信大部分的人都和Linux打过交道,因为我们的服务器一般都是装的Linux操作系统,包括各种云服务器也都是用的Linux,目前主流是CentOS7,那么对于一个 ...
- mysql中关于exists的深入讲解
mysql中关于exists的讲解 我认为exists语法是mysql中一个很强大的工具,可以简单地实现某些复杂的数据处理. 下面我谈谈与exists有关的三个方面. all 与 any 首先,看到了 ...
- .net core 集成 sentry 进行异常报警
.net core 集成 sentry 进行异常报警 Intro Sentry 是一个实时事件日志记录和汇集的平台.其专注于错误监控以及提取一切事后处理所需信息而不依赖于麻烦的用户反馈.它分为客户端和 ...
- c期末笔记(3)
参数于模运算 1.实参与形参易错点 实参与形参之间是值传递. 实参&形参 实参可以是:常量,表达式或者变量 形参只能是变量 指针和指针变量 1.指针的定义 指针的定义形式:int*p = &a ...
- python的字符串、列表、字典和函数
一.字符串 在python中字符串无需通过像php中的explode或者javascript中的split进行分解即可完成切片,可以直接通过下标获取字符串中的每一个字符,下标从0开始,如果从厚望签署, ...
- wireshark抓包实战(二),第一次抓包
1.选择网卡. 因为wireshark是基于网卡进行抓包的,所以这时候我们必须选取一个网卡进行抓包.选择网卡一般有三种方式 (1)第一种 当我们刚打开软件是会自动提醒您选择,例如: (2)第二种 这时 ...
- 最全的中文NLP资源库,你确定不来看一下吗?
最全的中文NLP资源库,你确定不来看一下吗? 22/100 发布文章 qq_39248703 hello,小伙伴们大家好,今天给大家分享NLP资源库,可以说是最全的资源库了,很多包非常有趣,值得收藏, ...
- 《深入理解 Java 虚拟机》读书笔记:晚期(运行期)优化
正文 在部分商用虚拟机(Sun HotSpot.IBM J9)中,Java 程序最初是通过解释器进行解释执行的,当虚拟机发现某个方法或代码块的运行特别频繁时,就会把这些代码认定为"热点代码& ...
- Docker php安装扩展步骤详解
前言 此篇,主要是演示docker-php-source , docker-php-ext-install ,docker-php-enable-docker-configure 这四个命令到底是用来 ...