日韩欧美人妻无码精品白浆,www.大香蕉久久网,狠狠的日狠狠的操,日本好好热在线观看

LOGO OA教程 ERP教程 模切知識(shí)交流 PMS教程 CRM教程 開發(fā)文檔 其他文檔  
 
網(wǎng)站管理員

windows服務(wù)器申請(qǐng)SSL證書及自動(dòng)續(xù)期

freeflydom
2025年6月10日 15:14 本文熱度 430

一、證書申請(qǐng)

  • 工具: Certbot
  • 端口需求: 80 
certbot certonly -d example.com --webroot

        交互窗口輸入IIS站點(diǎn)根目錄,以使certbot創(chuàng)建驗(yàn)證文件(通過http協(xié)議地址能夠被訪問到),由于生成驗(yàn)證文件不具備后綴名,在默認(rèn)IIS安全設(shè)置中是不允許此類鏈接訪問的,因此還需要在網(wǎng)站MIME類型中加個(gè)通配符類型『.』,配置其對(duì)應(yīng)的類型為『application/octet-stream』。
        驗(yàn)證通過后會(huì)將證書發(fā)布至C:\Certbot文件夾下,archive和live目錄下均會(huì)生成域名對(duì)應(yīng)的文件夾,live為有效的archive目錄下快捷方式。
        跳轉(zhuǎn)到live\example.com目錄下,會(huì)有cert.pem, chain.pem, fullchain.pem, privkey.pem幾個(gè)生成文件,其中fullchain和privkey是下一步需要的文件。

注: CertBot最新版本只支持Win7或以上系統(tǒng),對(duì)應(yīng)的Windows Server版本至少需要在Server 2012或以上,若是更早的WinServer操作系統(tǒng),需要下載低版本的CertBot,主要原因是其依賴的python環(huán)境不支持低版本操作系統(tǒng)。

二、證書類型轉(zhuǎn)換

  • 工具: openssl   
$env:MYPASS = "123"
openssl pkcs12 -export -out example.com.pfx -passout env:MYPASS -in fullchain.pem -inkey privkey.pem

三、證書導(dǎo)入與綁定

certutil -p 123 -importPFX example.com.pfx
$oSsl = $( ls Cert:\LocalMachine\My | ?{ $_.Subject -like "*example.com" } )
Import-Module WebAdministration
New-WebBinding -Name "Default Web Site" -IPAddress "*" -Port 443 -Protocol https
$oBind = Get-WebBinding -Name "Default Web Site" -Port 443 -Protocol https
$oBind.AddSslCertificate($oSsl.Thumbprint, "my")

四、建立自動(dòng)更新任務(wù)

  • 計(jì)劃任務(wù)建立

         每隔一個(gè)月執(zhí)行自動(dòng)檢測(cè)更新腳本

$oDT = Get-Date -Format "yyyyMMdd"
$nMo = [int]$oDT.substring(4,2) % 2
$strMonths = ""
if ($nMon -eq 1) {
	$strMonths = "1,3,5,7,9,11"
} else {
	$strMonths = "2,4,6,8,10,12"
}
$oDT -Match "(..)(..)(..)"
$strDT = "$($Matches[1])/$($Matches[2])/$($Matches[3])"
schtasks /create /tn UpdateSSL /sc MONTHLY /mo $strMonths /sd "$strDT" /st 00:30:00 /tr "powershell -Command \`"Set-ExecutePolicy -Scope Process Bypass; Start powershell $PWD\UpdateSSL.ps1;\`""
  •  詳細(xì)執(zhí)行內(nèi)容

        UpdateSSL.ps1

function pause() {
    Write-Host "Press any key to contiune..."
    [Console]::ReadKey() | Out-Null
}
function main() {
    pushd C:\Certbot\live\example.com\
    # Pull update state
    $strRet = $(certbot renew --cert-name example.com)
    $bUpdate = $($strRet | findstr /c:"No renewals")
    if ("$bUpdate" -ne "") {
        Write-Host "No new update, skip..."
    } else {
        Write-Host "Renewals founded, now export pfx file."
        # Backup old cert file
        Write-Host "Step 1: Backup the old pfx file."
        $strDT = $(Get-Date -Format "yyyyMMdd").ToString()
        mv example.com.pfx "backup_${strDT}_example.com.pfx"
        # Export cert as pkcs12 file
        Write-Host "Step 2: Export the new cert to pfx file."
        $env:cert_pass = "123"
        openssl pkcs12 -export -out example.com.pfx -passout env:cert_pass -in fullchain.pem -inkey privkey.pem
        # Delete old pfx in local machine
        Write-Host "Step 3: Delete the certification from cert store."
        ls Cert:\LocalMachine\My | ?{ $_.Subject -like "*example.com"} | rm
        # Import pfx to cert store
        Write-Host "Step 4: Import the new certification to cert store."
        certutil -f -p 123 -importPFX $PWD\example.com.pfx
        # ReBind certification of web site
        Write-Host "Step 5: Rebind the certification to default web site as https protocol."
        $oCert = $( ls Cert:\LocalMachine\My | ?{ $_.Subject -like "*example.com"} )
        $oCert
        $oBind = Get-WebBinding -Name "Default Web Site" -Protocol "https"
        $oBind
        Write-Host " Step 5.1: Remove certification from Default Web Site."
        $oBind.RemoveSslCertificate()
        #pause
        Write-Host " Step 5.2: Add new certification from Default Web Site."
        $oBind.AddSslCertificate($oCert.Thumbprint, "My")
        #pause
        # Restart web site
        Write-Host "Step 6: Restart the Default Web Site."
        $oWebSite = Get-WebSite -Name "Default Web Site"
        $oWebSite.Stop()
        $oWebSite.Start()
    }
    popd
}
main
pause

轉(zhuǎn)自https://blog.csdn.net/WGLNNGT/article/details/137587148


該文章在 2025/6/10 15:14:13 編輯過
關(guān)鍵字查詢
相關(guān)文章
正在查詢...
點(diǎn)晴ERP是一款針對(duì)中小制造業(yè)的專業(yè)生產(chǎn)管理軟件系統(tǒng),系統(tǒng)成熟度和易用性得到了國(guó)內(nèi)大量中小企業(yè)的青睞。
點(diǎn)晴PMS碼頭管理系統(tǒng)主要針對(duì)港口碼頭集裝箱與散貨日常運(yùn)作、調(diào)度、堆場(chǎng)、車隊(duì)、財(cái)務(wù)費(fèi)用、相關(guān)報(bào)表等業(yè)務(wù)管理,結(jié)合碼頭的業(yè)務(wù)特點(diǎn),圍繞調(diào)度、堆場(chǎng)作業(yè)而開發(fā)的。集技術(shù)的先進(jìn)性、管理的有效性于一體,是物流碼頭及其他港口類企業(yè)的高效ERP管理信息系統(tǒng)。
點(diǎn)晴WMS倉儲(chǔ)管理系統(tǒng)提供了貨物產(chǎn)品管理,銷售管理,采購管理,倉儲(chǔ)管理,倉庫管理,保質(zhì)期管理,貨位管理,庫位管理,生產(chǎn)管理,WMS管理系統(tǒng),標(biāo)簽打印,條形碼,二維碼管理,批號(hào)管理軟件。
點(diǎn)晴免費(fèi)OA是一款軟件和通用服務(wù)都免費(fèi),不限功能、不限時(shí)間、不限用戶的免費(fèi)OA協(xié)同辦公管理系統(tǒng)。
Copyright 2010-2025 ClickSun All Rights Reserved

亚洲专区日韩激情| 天天日天天干天天射天天好逼網| 操白丝美女逼| 亚洲国产剧情一区| 射精合集欧美| 国产精品美女三区| 色欲女人综合网在线观看| 国产美女一区二区在线| 欧美午夜片久久| 国产对白精品在线| 一区二区三区不卡av| 操操操操操操操操av| 二区日韩综合| 夫妻精品免费看视频下载| 天天上天天干天天日91| 熟女裸照国产二区| 夫妻性AV网站| 欧美 欧美 亚洲| 久草视频免费在线观看| 日本天天干天天澡天天色| 日本天天射高清| 亚洲老师成人在线电影| 国产小泬泬大香蕉| 三级片国产亚洲中文字幕欧美综合| 欧美操逼二区| 日韩熟妇尤物| 韩国精品久久精品| 本日三及网站理伦二区三区| 国产精品久久久久久一区二区| 中文字幕无码破解日韩电影| 色综合A不卡| 日本理沦视频| 中文字幕欧美无线码| 精品图套一区二区三区| 美女操小逼 插| caoporn成人A∨| 亚洲男人天堂精品影视| 日本韩国深夜视频免费观看| 免费成人久久久AV| 日韩欧美二区三区四区五区六区| 男生操女生屁眼视频免费看网站|