Skip to content

Conversation

@LeoBorai
Copy link
Member

@LeoBorai LeoBorai commented May 8, 2022

Revisits TLS and HTTPS serving. Adds support for PEM files loading.

@LeoBorai
Copy link
Member Author

LeoBorai commented May 8, 2022

@stackinspector I have been checking on the TLS certificates issue as you suggested on #128.
I did update the rustls PEM file parser crate and also ensure the buffer loads bytes from file as expected.

I tested the HTTP Server using certificates generated by mkcert,
here is the step by step on how I got it running.

  1. Create certificates with mkcert as follows:
mkcert -cert-file tmp/local.test-http-server.com.crt -key-file tmp/local.test-http-server.com.key local.test-http-server.com
  1. Then added local.test-http-server.com to my /etc/hosts file:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1             localhost

# Added by User
127.0.0.1       local.test-http-server.com
  1. Finally run the HTTP Server
cargo run -- --tls  --tls-cert ./tmp/local.test-http-server.com.crt --tls-key ./tmp/local.test-http-server.com.key --verbose --logger --tls-key-algorithm pkcs8 --proxy https://example.com
  1. Open your favorite browser and visit https://local.test-http-server.com:7879, you must see example.com through the proxy.

Please let me know any questions! I'm glad to help!

@LeoBorai LeoBorai linked an issue May 8, 2022 that may be closed by this pull request
@LeoBorai
Copy link
Member Author

@stackinspector given that now we are loading the PEM files accordingly Im merging this.
Please let me know any issues you have!

@LeoBorai LeoBorai marked this pull request as ready for review May 12, 2022 02:21
@LeoBorai LeoBorai merged commit 8c24eb8 into main May 12, 2022
@LeoBorai LeoBorai deleted the fix/tls-certs branch May 12, 2022 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot read any Certificate/Key files using RSA

2 participants