I refactored the TLS certificate lookup code in GitLab Pages. I moved the code that picks a domain's certificate during the TLS handshake out of app.go and into its own internal/tls package.
The goal was to keep the main application code simpler, and to make the certificate logic easier to test and extend.
What shipped:
- moved the certificate lookup into
GetConfigForClientin the new package, - moved TLS config setup into
GetTLSConfig, and updatedapp.goto call both, - added tests and fixed type and import issues during review.
Maintainers asked for several rounds of improvements to function signatures, error handling, and test coverage before merge. This made the final patch better.
In a follow-up, !1140, I added acceptance tests for slowlogs.Recorder.
Links: MR !1139 • Issue #708 • MR !1140