Add end-to-end HTTPS tests - #42
Merged
Merged
Conversation
The eunit fixture gains a TLS listener next to the TCP one, sharing the request handling via a transport parameter. Certs are generated at startup with public_key:pkix_test_data/1 (secp256r1/sha256 -- the helper's default secp112r2/sha1 key is not negotiable by a modern TLS client), so no cert files or test deps are needed. The subtests are parameterized by base URL and now also run over https on shackle_ssl, plus shackle_ssl_socket gated on OTP 28+, mirroring the shackle_socket gate. The client connects with verify_none since the cert is self-signed. The option() type and README only admitted shackle_socket and shackle_tcp for protocol, even though https pools honor the option since bf913db; both now list all four transports. Closes #28
The eunit generators tear the fixture down and restart it back to back. stop/0 fired exit(kill) without waiting, so the next start/0 could race the dying process for the registered name and crash init/1 on register/2, surfacing as an opaque setup timeout on CI. stop/0 now blocks on the DOWN signal, and init/1 reports its crash reason to the caller instead of timing out silently.
Even with stop/0 waiting on the DOWN signal, ERTS releases the dead fixture's ports asynchronously, so the next start/0 can still hit eaddrinuse when it rebinds immediately. Retry the listens briefly instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
gen_tcp/ssl). Certs are generated at startup withpublic_key:pkix_test_data/1(secp256r1/sha256— the helper's defaultsecp112r2/sha1key is not negotiable by a modern TLS client), so no cert files or test deps are needed.shackle_ssl, plusshackle_ssl_socketgated on OTP 28+, mirroring the existingshackle_socketgate. The client connects withverify_nonesince the cert is self-signed.option()type and README only admittedshackle_socket | shackle_tcpforprotocol, even though https pools honor the option since bf913db; both now list all four transports.Stacked on #41; retargets to master once that merges.
Closes #28