- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
用谷歌搜索了很多,没有找到以下问题的答案:
创建了服务器代码和客户端代码,但是得到了
error:1408A0C1:SSL routines:SSL3_GET_CLIENT_HELLO:no shared cipher
SSL_connect
时。
SSL_accept
/
SSL_connect
之前的调用不会返回任何失败代码。我还省略了初始化方法。
hostname
,
certificate_chain_file
,
ca_certificate_file
):
SSL_library_init(); // <<< To clarify my initialization
OpenSSL_add_all_algorithms(); // <<< To clarify my initialization
SSL_load_error_strings(); // <<< To clarify my initialization
ERR_load_crypto_strings(); // <<< To clarify my initialization (2)
OpenSSL_add_all_ciphers(); // <<< To clarify my initialization (2)
SSL_METHOD const * method = SSLv23_method(); // <<< Updated method
SSL_CTX * ctx = SSL_CTX_new(method);
SSL_CTX_use_certificate_chain_file(ctx, certificate_chain_file));
const long flags = SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_COMPRESSION; // <<< Added
SSL_CTX_set_options(ctx, flags); // <<< Added
SSL_CTX_load_verify_locations(ctx, ca_certificate_file, NULL));
struct hostent * host = gethostbyname(hostname);
int client_sd = socket(PF_INET, SOCK_STREAM, 0);
struct sockaddr_in server;
memset(&server, 0, sizeof(server));
server.sin_family = AF_INET;
server.sin_port = htons(6789);
server.sin_addr.s_addr = *(long *) (host->h_addr);
connect(client_sd, (struct sockaddr *) &server, sizeof(server));
SSL * ssl = SSL_new(ctx);
SSL_set_fd(ssl, client_sd);
const char * const preferred_ciphers = "HIGH:!aNULL:!kRSA:!PSK:!SRP:!MD5:!RC4";
SSL_set_cipher_list(ssl, preferred_ciphers); // <<< Added
SSL_set_tlsext_host_name(ssl, hostname); // <<< Added
mydata_t mydata;
mydata_index_client = SSL_get_ex_new_index(0, (void *) "mydata index", NULL, NULL, NULL);
SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, verify_callback_client);
SSL_CTX_set_verify_depth(ctx, 1);
mydata.verify_depth = 0;
SSL_set_ex_data(ssl, mydata_index_client, &mydata);
int connection_result = SSL_connect(ssl);
if (connection_result < 0)
{
// Comes in here and ERR_get_error indicates
// error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure
}
else if (connection_result == 0)
{
}
else if (connection_result == 1)
{
}
else
{
}
certificate_chain_file
,
ca_certificate_file
):
SSL_library_init();
OpenSSL_add_all_algorithms();
SSL_load_error_strings();
SSL_METHOD const * method = SSLv23_method();
SSL_CTX * ctx = SSL_CTX_new(method);
SSL_CTX_use_certificate_chain_file(ctx, certificate_chain_file); //Contains only root CA
SSL_CTX_set_default_passwd_cb_userdata(ctx, (void *) private_key_file_password);
SSL_CTX_set_default_passwd_cb(ctx, pem_passwd_cb);
SSL_CTX_load_verify_locations(ctx, ca_certificate_file, NULL);
struct sockaddr_in addr;
int server_sd = create_socket(addr, 6789);
bind(server_sd, (struct sockaddr *) &addr, sizeof(addr));
listen(server_sd, max_nr_of_simultaneous_connections);
sockaddr_in client;
client.sin_family = AF_INET;
socklen_t c_len = sizeof(client);
int client_sd = accept(server_sd, (sockaddr *) &client, &c_len);
char remote_addr[INET_ADDRSTRLEN];
inet_ntop(client.sin_family, &(client.sin_addr), remote_addr, INET_ADDRSTRLEN);
SSL * ssl = SSL_new(ctx);
SSL_set_fd(ssl, client_sd);
const char * const preferred_ciphers = "HIGH:!aNULL:!kRSA:!PSK:!SRP:!MD5:!RC4";
SSL_set_cipher_list(ssl, preferred_ciphers); // <<< Added
STACK_OF(X509_NAME) * cert_names = SSL_load_client_CA_file(certificate_chain_file);
if (cert_names != NULL)
{
SSL_CTX_set_client_CA_list(ctx, cert_names);
}
mydata_t mydata;
mydata_index_server = SSL_get_ex_new_index(0, (void *) "mydata index", NULL, NULL, NULL);
SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, verify_callback_server);
SSL_CTX_set_verify_depth(ctx, 1);
mydata.verify_depth = 1;
SSL_set_ex_data(ssl, mydata_index_server, &mydata);
int accept_result = SSL_accept(ssl);
if (accept_result == 0)
{
}
else if (accept_result < 0)
{
// Comes in here and ERR_get_error indicates
// error:1408A0C1:SSL routines:SSL3_GET_CLIENT_HELLO:no shared cipher
}
HOME = .
RANDFILE = $ENV::HOME/.rnd
####################################################################
[ ca ]
default_ca = CA_default # The default ca section
####################################################################
[ CA_default ]
default_days = 1000 # how long to certify for
default_crl_days = 30 # how long before next CRL
default_md = sha256 # use public key default MD
preserve = no # keep passed DN ordering
x509_extensions = ca_extensions # The extensions to add to the cert
email_in_dn = no # Don't concat the email in the DN
copy_extensions = copy # Required to copy SANs from CSR to cert
base_dir = .
certificate = $base_dir/certs/ca_fromweb.cert.pem # The CA certifcate
private_key = $base_dir/private/ca.key.pem # The CA private key
new_certs_dir = $base_dir # Location for new certs after signing
database = $base_dir/index2.txt # Database index file
serial = $base_dir/serial2.txt # The current serial number
unique_subject = no # Set to 'no' to allow creation of
# several certificates with same subject.
####################################################################
[ req ]
default_bits = 4096
default_keyfile = ./private/ca.key.pem
distinguished_name = ca_distinguished_name
x509_extensions = ca_extensions
string_mask = utf8only
####################################################################
[ ca_distinguished_name ]
countryName = Country Name (2 letter code)
countryName_default = SE
stateOrProvinceName = State or Province Name (full name)
stateOrProvinceName_default = Östergötland
localityName = Locality Name (eg, city)
localityName_default =
organizationName = Organization Name (eg, company)
organizationName_default =
organizationalUnitName = Organizational Unit (eg, division)
organizationalUnitName_default =
commonName = Common Name (e.g. server FQDN or YOUR name)
commonName_default =
emailAddress = Email Address
emailAddress_default =
####################################################################
[ ca_extensions ]
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid:always, issuer
basicConstraints = critical, CA:true
keyUsage = keyCertSign, cRLSign
####################################################################
[ signing_policy ]
countryName = optional
stateOrProvinceName = optional
localityName = optional
organizationName = optional
organizationalUnitName = optional
commonName = supplied
emailAddress = optional
####################################################################
[ signing_req ]
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid,issuer
basicConstraints = CA:FALSE
keyUsage = digitalSignature, keyEncipherment
HOME = .
RANDFILE = $ENV::HOME/.rnd
####################################################################
[ req ]
default_bits = 2048
default_keyfile = ./intermediate/private/my.example.com.key.pem
distinguished_name = server_distinguished_name
req_extensions = server_req_extensions
string_mask = utf8only
####################################################################
[ server_distinguished_name ]
countryName = Country Name (2 letter code)
countryName_default = SE
stateOrProvinceName = State or Province Name (full name)
stateOrProvinceName_default = Östergötland
localityName = Locality Name (eg, city)
localityName_default = Linköping
organizationName = Organization Name (eg, company)
organizationName_default =
commonName = Common Name (e.g. server FQDN or YOUR name)
commonName_default =
emailAddress = Email Address
emailAddress_default =
####################################################################
[ server_req_extensions ]
subjectKeyIdentifier = hash
basicConstraints = CA:FALSE
keyUsage = digitalSignature, keyEncipherment
subjectAltName = @alternate_names
nsComment = "OpenSSL Generated Certificate"
####################################################################
[ alternate_names ]
DNS.1 = my.example.com
touch index.txt
echo 1000 > serial
openssl genrsa -aes256 -out ca.key.pem 4096
chmod 400 private/ca.key.pem
openssl req -config openssl-ca.cnf -key ca.key.pem -new -x509 -days 7300 -sha256 -extensions ca_extensions -out ca.cert.pem
chmod 444 ca.cert.pem
openssl genrsa -aes256 -out server.key.pem 4096
openssl req -config openssl-server.cnf -new -sha256 -key server.key.pem -out my.example.com.csr.pem
openssl ca -config openssl-ca.cnf -policy signing_policy -extensions signing_req -out my.example.com.cert.pem -infiles my.example.com.csr.pem
chmod 444 my.example.com.cert.pem
cat ca.cert.pem > ca_chain.cert.pem
ERR_load_crypto_strings(); // <<< To clarify my initialization (2)
OpenSSL_add_all_ciphers(); // <<< To clarify my initialization (2)
最佳答案
“no shared cipher” at ssl_accept, why?
Client:
SSL_METHOD const * method = SSLv3_client_method();
Server:
SSL_METHOD const * method = SSLv23_method();
const SSL_METHOD* method = SSLv23_method();
if(method == NULL) handleFailure();
ctx = SSL_CTX_new(method);
if(ctx == NULL) handleFailure();
...
/* Cannot fail ??? */
const long flags = SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_COMPRESSION;
SSL_CTX_set_options(ctx, flags);
SSL_set_tlsext_host_name
一起使用。 SNI是TLS扩展,它是您希望使用“TLS 1.0及更高版本”的部分原因。
"HIGH:!aNULL:!kRSA:!PSK:!SRP:!MD5:!RC4"
这样的密码套件列表。使用
SSL_CTX_set_cipher_list
或
SSL_set_cipher_list
设置它们。它避免了来自浏览器的
“Your connection to website is encrypted with obsolete cryptography”警告。
关于encryption - ssl_accept上的“no shared cipher”,为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40454338/
我正在对 Share 开发和执行一些自定义。我的 IDE 是 Eclipse Juno,工作区由以下元素组成: 露天网络项目 扩展 Java 项目 分享网站项目 alfresco 和 share we
这是我一直面临的一个非常奇怪的问题。我正在使用 Share.share,它将消息、主题 (ios) 和标题(对于 gmail)作为参数。在android中它工作正常。即主题行是“我是标题”,而消息正文
当在static上下文中未使用而不是时(也就是说,当static关键字不存在并且您不在全局范围内时),shared和__gshared关键字有什么作用? 例子: struct Temp {
我想知道如何从 Surf 中的 Root 对象知道当前主机名。 我正在编写一个服务于 JNLP 的网络脚本,所以我没有页面上下文,并且 ${url.context} 只返回 /share。 我正在寻找
我想知道如何从 Surf 中的 Root 对象知道当前主机名。 我正在编写一个服务于 JNLP 的网络脚本,所以我没有页面上下文,并且 ${url.context} 只返回 /share。 我正在寻找
我需要在 Alfresco Share 上下文中创建一个无需身份验证即可访问的页面。使用页面框架时,它看起来非常简单,因为您可以添加 none到页面定义。 当使用 aikau 时,页面定义消失了,我只
我有执行REST命令并处理结果的python脚本。我希望该脚本可被不同的Jenkins Pipelines使用,我通过Jenkins官方文档发现的一种方式是使用“共享库”,而这些示例(以及我在网上找到
查看此函数(矩阵 vector 积): std::vector times(std::vector > const& A, std::vector const& b, int m, int n) {
我正在尝试弄清楚如何与 Alfresco Share 执行一些 dashlet 间通信。 这是一个简单的用例: 我们确实有 2 个 dashlet,我们称它们为 A 和 B。我希望能够在 A 中填写字
是否可以在 Snowflake 的 FUNCTION 或 PROCEDURE 中发出“Show Shares”函数调用?由于信息架构中没有元数据对象来查询有关共享的信息,因此我们正在寻找一种方法来创建
我对“无共享”分布式系统的理解是集群中的每个节点都有自己的磁盘可以持久化。如果是这种情况,我不确定为什么拥有这样的架构会有好处,因为您不仅需要在应用程序级别进行复制/负载平衡/集群,而且还需要在磁盘上
我对“无共享”分布式系统的理解是集群中的每个节点都有自己的磁盘可以持久化。如果是这种情况,我不确定为什么拥有这样的架构会有好处,因为您不仅需要在应用程序级别进行复制/负载平衡/集群,而且还需要在磁盘上
在 Alfresco 4.0 中,我想扩展 Share Doclib Filter webscript 以添加我自己的自定义过滤器。 有没有一种简单的方法可以在 share-config-custom
假设我要匹配: PREFIXsomething 或: somethingPOSTFIX 但肯定不是: PREFIXsomethingPOSTFIX 其中 something 是某种共享模式,而 PRE
我正在寻找一种使用 JavaScript 在 google drive sdk 上查找用户共享文件列表的方法。 重要提示:我不是在寻找“与我共享”的文件列表。 我目前所拥有的列出了“与我共享”的文件,
最近刚开始使用 swifting,在使用应用程序组在 iOS 设备之间共享数据时遇到了问题。 基本上我已经按照以下步骤设置了项目: [iPhone] 为 iPhone 目标启用应用程序组 初始化数据如
我知道 -Wl,-shared 是 ld 的一个选项。我见过有人这样编译, $ gcc -shared -Wl,-soname,libtest.so -o libtest.so *.o 还有这样的人
我想知道对这句名言最接地气的解释是什么: Don't communicate by sharing memory; share memory by communicating. (R. Pike) 在
我不确定我在这里做错了什么,我认为应该有更多的文档或关于这个Web Share API的更好的错误描述。。我正在尝试共享以下文件。使用。我已经确保该类型是允许的类型,但我一直收到DOMExceptio
我正在研究 RxSwift 和 RxCocoa。官方文档中有这些解释。 分享副作用 分享资源 它们是一样的吗?如果有区别,那有什么区别?光看官方文档的解释,我看不懂。 预先感谢您的回答。 最佳答案 文
我是一名优秀的程序员,十分优秀!