SSL Configuration Error After Removing SharePoint Web Application
[Occurred on SharePoint 2016]
When you delete a web application in SharePoint, whether through PowerShell or Central Admin, you can instruct SharePoint to remove the associated IIS site with it. However, if the web application is running on port 443, the SSL certificate binding may need to be cleaned up manually.
At first glance, one might assume that deleting the IIS site would automatically remove the SSL binding, as the site would no longer be available. Unfortunately, this is not always the case. This can be verified by checking the Windows System event logs, which would become flooded with Event ID 15021 errors if the binding is not cleaned up:
"An error occurred while using SSL configuration for endpoint <webAppIP>:443. The error status code is contained within the returned data."
Diagnosis
Use the netsh http command to diagnose and fix the error. You can include the reported IP address from the System event logs in the command to verify the existence of the certificate binding:
netsh http show sslcert ipport=<ipAddress:port>
Example: