Добавить
Уведомления

Crear certificado SSL y asignarselo a Web HTTPS con IIS desde PowerShell | Windows Server 2019

En este tutorial explicaré como crear un certificado ssl para nuestra web en el iis y asignarselo, todo desde la PowerShell del Windows Server 2019 ----------------------Creación e instalación de Certificado--------------------------- - Creamos el certificado: $cert = New-SelfSignedCertificate -CertStoreLocation cert:\localmachine\my -DnsName ies.antoniorg.local $cert $secPassword = ConvertTo-SecureString -String 'mismo!' -Force -AsPlainText Get-ChildItem -path Cert:\LocalMachine\My $certPath = "Cert:\localMachine\my\Nombre_del_certificado_que_creamos" - Exportamos el certificado y lo importamos al nuestros certificados y a los de confianza Export-PfxCertificate -Cert $certPath -FilePath c:\selfcert.pfx -Password $secPassword Import-PfxCertificate -Password $secPassword -FilePath C:\selfcert.pfx -CertStoreLocation "Cert:\CurrentUser\My" Import-PfxCertificate -Password $secPassword -FilePath C:\selfcert.pfx -CertStoreLocation "Cert:\CurrentUser\Root" -Confirm - Asignamos el certificado a su respectiva web $certPath = "Cert:\LocalMachine\My\Nombre_del_certificado_que_creamos" $providerPath = "IIS:\SslBindings\IP!Protocolo" Get-Item $certPath | New-Item $providerPath -------------------------------------Datos Importantes--------------------------------- - Vemos las Webs que tenemos: Get-Website - Como parar una Web: Stop-Website -Name "Nombre_Web" - Como iniciar una Web: Start-Website -Name "Nombre_Web" - Como borrar una Web: Remove-Website -Name "Nombre_Web" - Como crear la ruta de la Web: New-Website -Name "Nombre_Web" -PhysicalPath "Ruta" - Como crear la dirección de la Web: New-WebBinding -Name "Nombre_Web" -IPAddress "IP" -Port "Puerto" -Protocol "Protocolo" -HostHeader "cname.dominio.local" - Como ver los certificados que tenemos: Get-ChildItem -path Cert:\LocalMachine\My Get-ChildItem -path Cert:\LocalMachine\Root

12+
16 просмотров
2 года назад
12+
16 просмотров
2 года назад

En este tutorial explicaré como crear un certificado ssl para nuestra web en el iis y asignarselo, todo desde la PowerShell del Windows Server 2019 ----------------------Creación e instalación de Certificado--------------------------- - Creamos el certificado: $cert = New-SelfSignedCertificate -CertStoreLocation cert:\localmachine\my -DnsName ies.antoniorg.local $cert $secPassword = ConvertTo-SecureString -String 'mismo!' -Force -AsPlainText Get-ChildItem -path Cert:\LocalMachine\My $certPath = "Cert:\localMachine\my\Nombre_del_certificado_que_creamos" - Exportamos el certificado y lo importamos al nuestros certificados y a los de confianza Export-PfxCertificate -Cert $certPath -FilePath c:\selfcert.pfx -Password $secPassword Import-PfxCertificate -Password $secPassword -FilePath C:\selfcert.pfx -CertStoreLocation "Cert:\CurrentUser\My" Import-PfxCertificate -Password $secPassword -FilePath C:\selfcert.pfx -CertStoreLocation "Cert:\CurrentUser\Root" -Confirm - Asignamos el certificado a su respectiva web $certPath = "Cert:\LocalMachine\My\Nombre_del_certificado_que_creamos" $providerPath = "IIS:\SslBindings\IP!Protocolo" Get-Item $certPath | New-Item $providerPath -------------------------------------Datos Importantes--------------------------------- - Vemos las Webs que tenemos: Get-Website - Como parar una Web: Stop-Website -Name "Nombre_Web" - Como iniciar una Web: Start-Website -Name "Nombre_Web" - Como borrar una Web: Remove-Website -Name "Nombre_Web" - Como crear la ruta de la Web: New-Website -Name "Nombre_Web" -PhysicalPath "Ruta" - Como crear la dirección de la Web: New-WebBinding -Name "Nombre_Web" -IPAddress "IP" -Port "Puerto" -Protocol "Protocolo" -HostHeader "cname.dominio.local" - Como ver los certificados que tenemos: Get-ChildItem -path Cert:\LocalMachine\My Get-ChildItem -path Cert:\LocalMachine\Root

, чтобы оставлять комментарии