Posts

Showing posts with the label Website Security

HTTP error 413 - get and set uploadReadAheadSize in IIS

Image
In this post, I describe how to get and set uploadReadAheadSize in IIS to fix the error: "An unknown error occurred while processing the request on the server. The status code returned from the server was: 413" Cause This error occurred after I created a self-signed SSL certificate and tried to access a site in IIS over HTTPS. Error code 413 means "Request Entity Too Large". Resolution To resolve the issue, I increased the uploadReadAheadSize in IIS as follows: - Open IIS - Select your site in the treeview on the left - Open Configuration Editor : - Open the Section drop down, expand system.webServer then select serverRuntime : - Here you can check your current uploadReadAheadSize and set a new value in bytes between 0 and 2147483647 ( more information from Microsoft ) - Click outside uploadReadAheadSize then press Apply in the top right to save your changes Error 413 should now be resolved. Related Posts - NET::ERR_CERT_WEAK_SIGNATURE_ALGORITHM - IIS SSL Certifi...

NET::ERR_CERT_WEAK_SIGNATURE_ALGORITHM - IIS SSL Certificate

Image
In this post, I descibe how to fix the error: NET::ERR_CERT_WEAK_SIGNATURE_ALGORITHM which can occur after you create a self-signed SSL certificate for an HTTPS binding in an IIS web site when you try to access that site in a modern browser such as Chrome or Edge: This is a follow up to my previous post: Mismatched Address certificate error - HTTPS localhost IIS Cause If you followed the steps in my previous post, the certificate is created with the certificate signature algorithm PKCS #1 SHA-1 With RSA Encryption : In 2017, SHA-1 was proven insecure and thus Chrome and Edge flag it as not secure. Resolution The New-SelfSignedCertificate cmdlet includes a HashAlgorithm parameter which can be set to SHA-256 .  This can easily be added to the PowerShell script from my previous post as follows:  $rootcertname = "ROOT" $certname = "localhost"   # Create the root certificate $rootcert = New-SelfSignedCertificate `        ...

The hostname in the website’s security certificate differs from the website you are trying to visit.

Image
In this post, I describe how to fix the error The hostname in the website’s security certificate differs from the website you are trying to visit. Error Code: DLG_FLAGS_SEC_CERT_CN_INVALID This error can occur when you browse to an HTTPS address: Cause This can occur when you have configured an IIS Site Binding to use HTTPS but there is a problem with the certificate you have selected. Resolution To resolve the issue, follow the steps in my other post  Mismatched Address certificate error - HTTPS localhost IIS Related Posts - Mismatched Address certificate error - HTTPS localhost IIS - How to create a self-signed public certificate - Powershell

Mismatched Address certificate error - HTTPS localhost IIS

Image
In this post, I describe how to use HTTPS with SSL on a local IIS development environment without the Mismatched Address certificate error: Cause This error can occur when you use Create Self-Signed Certificate in IIS.  The error says "Mismatched Address" and that the server cannot prove that it is its name. Resolution To resolve the issue, you can use the PowerShell cmdlet  New-SelfSignedCertificate to create the certificates. The following PowerShell code will create the root certificate, then create the SSL certificate signed by the root certificate, then import the root certificate into the Trusted Root Certification Authorities store: # Create the root certificate and store the thumbprint in a variable $thumb = ( New-SelfSignedCertificate -Type "Custom" -KeyExportPolicy "Exportable" -Subject "ROOT" -CertStoreLocation "Cert:\LocalMachine\My" -KeySpec "Signature" -KeyUsage "CertSign" -NotAfter ( Get-Date ) . A...