Please check for errors my sequence of Docker (the base image is rust:1.78
) commands, that intents to make localhost
the CA root and install certs for my (custom written) Web server serving https://localhost:443/<PATH>
with keys at test/e2e/tmpl/
:
RUN openssl genrsa -passout pass: -out CA.key -des3 2048
RUN openssl req -passin pass: -x509 -sha256 -new -nodes -key CA.key -out CA.pem -subj '/CN=localhost/O=My Company Name LTD./C=US'
RUN openssl genrsa -passout pass: -out localhost.key -des3 2048
RUN openssl req -passin pass: -new -key localhost.key -out localhost.csr -subj '/CN=localhost/O=My Company Name LTD./C=US'
RUN openssl x509 -passin pass: -req -in localhost.csr
-CA CA.pem -CAkey CA.key
-CAcreateserial -sha256
-extfile localhost.ext -out localhost.crt
RUN openssl rsa -passin pass: -in localhost.key -out localhost.decrypted.key
RUN mkdir -p test/e2e/tmpl/
RUN cp localhost.crt localhost.decrypted.key test/e2e/tmpl/
# TODO: CA.key or CA.pem?
RUN cp CA.key CA.pem /usr/local/share/ca-certificates
RUN update-ca-certificates
If the above sequence of command is erroneous, please provide me a correct one.
Weirdly, curl https://localhost
works as intended, but another Rust-hyper-based software produces: error sending request for url (https://localhost/)
error.
1