Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We have a customer who is doing a setup in a complex environment, and while their TLS certificates are valid relative to their internal web browsers, they are not valid relative to the Snipe-IT instance, itself - it doesn't know about the certificates. And it really shouldn't need to, either.
And the one (that I know of) place where we actually try to fetch pages from our own instance is when we check for the
.env
file to see if it's exposed. And instead of failing 'nicely' when the certificate is 'bad', it actually 500's.This just turns off the TLS certificate checking during that check. I also added a test stub but I wasn't able to figure out how to fill it out, so I marked it as Incomplete. As another precaution, I also decided to widen the exception handler to get all Exceptions, and not just
HttpClientException
- which, according to PHPStorm, never gets thrown anywhere anyways.For tests, as per @jerm 's recommendation, I used BadSSL's "self-signed" URL - https://self-signed.badssl.com. I had to do some nasty hard-coding to get the test to work, but when I did that, on develop, that certificate check did cause the 500. On my branch, it did not. So I'm pretty sure this fixes the problem.