Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Batch file 使用批处理文件提取证书_Batch File_Https_X509 - Fatal编程技术网

Batch file 使用批处理文件提取证书

Batch file 使用批处理文件提取证书,batch-file,https,x509,Batch File,Https,X509,在Windows中是否有任何方法可以使用批处理文件(或powershell脚本)下载https证书?在Linux中,我可以使用openssl s_客户端-连接… 我如何在windows中实现它(不使用第三方openssl实现) 不久前,我编写了一个测试WebServerSSLPowerShell脚本,该脚本执行以下操作:。该函数使用内置的System.Net.WebRequest类及其属性 只需将该函数复制/粘贴到PowerShell控制台,并通过指定远程服务器主机名调用它: Test-WebS

在Windows中是否有任何方法可以使用批处理文件(或powershell脚本)下载https证书?在Linux中,我可以使用openssl s_客户端-连接…
我如何在windows中实现它(不使用第三方openssl实现)

不久前,我编写了一个
测试WebServerSSL
PowerShell脚本,该脚本执行以下操作:。该函数使用内置的
System.Net.WebRequest
类及其属性

只需将该函数复制/粘贴到PowerShell控制台,并通过指定远程服务器主机名调用它:

Test-WebServerSSL www.mydomain.com
请注意,您必须只键入远程服务器的主机名,而不键入协议前缀和相对URL路径

要将证书保存到文件,可以将输出对象发送到
Set Content
cmdlet:

$SSL = Test-WebserverSSL www.mydomain.com
Set-Content -Path $CertificateFile -Value $SSL.Certificate.RawData -Encoding Byte

谢谢你,我会看看的!有没有办法使用
opensslx509-outformpem>foo在openssl中保存它