jpsider / RestPS

Simple ReST Framework for Powershell
MIT License
114 stars 31 forks source link

Should not accept an empty ssl cert #88

Closed matsmcp closed 3 months ago

matsmcp commented 3 months 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