我正在我的组件中进行一个简单的提取调用,看起来像这样
var x = fetch(SOME_URL, SOME_POST_DATA)
.then((response) => response.json())
.then((responseJSON) => {return responseJSON});
console.log(x);
Run Code Online (Sandbox Code Playgroud)
调用成功执行,但控制台打印了promise而不是数据.我在这里错过了什么?
我有一个.pfx文件,在windows客户端上使用时可以完美连接远程服务器。我现在想使用 linux 客户端连接到服务器。
问题 1)我使用以下 openssl 命令从 pfx 文件中提取公共证书和私钥,
openssl pkcs12 -in Name.pfx -nocerts -out priv.pem -nodes
openssl pkcs12 -in Name.pfx -nokeys -out pub.pem
Run Code Online (Sandbox Code Playgroud)
但是当我运行以下两个命令来验证两个文件的 md5 时,我发现它们都不同。
openssl rsa -noout -text -in priv.pem | openssl md5
openssl x509 -noout -text -in pub.pem | openssl md5
Run Code Online (Sandbox Code Playgroud)
问题 2)我改为使用以下命令从具有证书和密钥的 pfx 中提取单个 pem 文件。
openssl pkcs12 -in Name.pfx -out bundle.pem
Run Code Online (Sandbox Code Playgroud)
使用这个 pem 文件,我尝试使用以下命令连接到远程服务器:
openssl s_client -servername 1.2.3.4 -connect 1.2.3.4:1234 -CAfile bundle.pem -state -tls1_2
Run Code Online (Sandbox Code Playgroud)
这在终端上给出以下输出
CONNECTED(00000003)
SSL_connect:before/connect initialization
SSL_connect:SSLv3 write client hello A
SSL_connect:SSLv3 …Run Code Online (Sandbox Code Playgroud)