时间:2020-04-24来源:电脑系统城作者:电脑系统城
最近发现我们开发环境的 IIS 上的 SSL 证书过期了,为了后面方便维护和更新,搞了一个 powershell 脚本,以后要更新的时候直接跑一下脚本就可以了,所以有了这篇文章
更新过程:
完整的更新脚本如下:
Copy
$hostName = "xxx.com" $pfxCertPath = "C:\backup\xxxxx.pfx" $pfxCertPwdPath = "C:\backup\pfx-password.txt" $certImportPwd = Get-Content $pfxCertPwdPath | ConvertTo-SecureString -AsPlainText -Force # try remove before ssl certs Get-ChildItem "cert:\LocalMachine\My" | where-object { $_.Subject -like "*$hostName*" } | Remove-Item # import new ssl $importedCert = Import-PfxCertificate -FilePath $pfxCertPath -CertStoreLocation "Cert:\LocalMachine\My" -p $certImportPwd $certHash = $importedCert.Thumbprint # remove sslcert binding netsh http delete sslcert hostnameport="${hostName}:443" # add new sslcert binding $guid = [guid]::NewGuid().ToString("B") netsh http add sslcert hostnameport="${hostName}:443" certhash=$certHash certstorename=MY appid="$guid"
2023-03-17
Nginx主机域名配置实现2023-03-17
Nginx配置-日志格式配置方式2023-03-17
Apache APISIX Dashboard 未授权访问漏洞分析(CVE-2021-45232)正常项目无法访问(Linux 服务器),启动tomcat时卡在下图位置,项目无法启动。1、先检查tomcat日志、项目日志没有报错信息,且没再产生新的日志信息。2、jdk、tomcat 、 jvm 配置,服...
2023-03-15
这篇文章主要介绍了Kubernetes中Nginx服务启动失败排查流程(Error: ImagePullBackOff),本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以...
2023-03-15