我成功地使用Tomcat和SSL证书设置了两台Ubuntu机器.我使用Centos 6完全遵循相同的程序,但是当我尝试连接到服务器(使用Opera)时,我得到了这个:
服务器有一个弱的,短暂的Diffie-Hellman公钥
连接器如下,catalina.log中没有错误:
<Connector port="some port number"
protocol="org.apache.coyote.http11.Http11Protocol"
SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile="path to jks"
keystoreType="JKS"
keystorePass="mypass1"
keyPass="mypass2" />
Run Code Online (Sandbox Code Playgroud)
使用Firefox,我得到了不受信任的通信错误.
将互斥引用传递给线程会导致编译错误.为什么不可能(我有多个线程使用相同的共享变量),我该如何解决?
#include<iostream>
#include<thread>
#include<mutex>
void myf(std::mutex& mtx)
{
while(true)
{
// lock
// do something
// unlock
}
}
int main(int argc, char** argv)
{
std::mutex mtx;
std::thread t(myf, mtx);
t.join();
return 0;
}
Run Code Online (Sandbox Code Playgroud)