jpsider / RestPS

Simple ReST Framework for Powershell
MIT License
113 stars 30 forks source link

Should not accept an empty ssl cert #88

Closed matsmcp closed 4 weeks ago

matsmcp commented 1 month ago

While working on my other patch I found what I think is an issue with Invoke-startlistner.

If you call Start-RestPSListener with an empty SSLThumbprint parameter, restPS will start with a HTTP listner.

This pull request changes this so that if the SSLThumbprint parameter is used, it also must contain a valid thumbprint.

I set SSLThumbprint="none" as default in Invoke-StartListener.

In Invoke-startlistner I now check if SSLThumbprint="none" If so the user did not try to use SSLThumbprint and a http listner is started

If it's empty - the user used SSLThumbprint but failed to provide a cert thumbprint - thats an error If it has a value - use the existing code to validate it