-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(WIP) : HTTPS support for manufacturing-server and manufacturing-client for DI #579
base: main
Are you sure you want to change the base?
Conversation
0a84b37
to
baab2b4
Compare
baab2b4
to
87e96b8
Compare
87e96b8
to
15f22ec
Compare
15f22ec
to
3b57dce
Compare
3a58471
to
f0c60c0
Compare
- warp::service and hyper::server combination used to run https server - separate bind address for http and https - tls_config containes tls config for htpps - now manufacturing-server supports both http and https requests from client. Signed-off-by: Sarita Mahajan <[email protected]>
- changes on client side to support https request Signed-off-by: Sarita Mahajan <[email protected]>
- still WIP Signed-off-by: Sarita Mahajan <[email protected]>
f0c60c0
to
5d71f77
Compare
// cfg.insert("manufacturing_server_https_cert_path", "/workspaces/fido-device-onboard-rs/integration-tests/tests/test-data/https-test"); | ||
// cfg.insert("manufacturing_server_https_key_path", "/workspaces/fido-device-onboard-rs/integration-tests/tests/test-data/https-test"); | ||
// cfg.insert("bind_http", "8085"); | ||
// cfg.insert("bind_https", &("127.0.0.1:{}" )); |
Check notice
Code scanning / devskim
Accessing localhost could indicate debug code, or could hinder scaling. Note test
@@ -801,6 +900,7 @@ | |||
"bind", | |||
&format!("127.0.0.1:{}", self.server_number.server_port().unwrap()), | |||
); | |||
cfg.insert("bind_https", &format!("127.0.0.1:{}", 6000)); |
Check notice
Code scanning / devskim
Accessing localhost could indicate debug code, or could hinder scaling. Note test
|
||
// Set subject for the certificate | ||
let mut name_builder = X509NameBuilder::new()?; | ||
name_builder.append_entry_by_nid(openssl::nid::Nid::COMMONNAME, "localhost")?; |
Check notice
Code scanning / devskim
Accessing localhost could indicate debug code, or could hinder scaling. Note test
This PR (currently in draft state) contains-
(Meanwhile to test manually, use following commands )
To create key & certs:
openssl genpkey -algorithm RSA -out server.key
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
Mention this address in manufacturing_server_https_key and manufacturing_server_https_cert fields in manufacturing_server.config file.
(This part to generate cert and key will be taken care in separate PR as a part of admin-tool)
sudo MANUFACTURING_SERVER_CONF=/usr/share/fdo/manufacturing_server.yml LOG_LEVEL=trace ./target/debug/fdo-manufacturing-server
HTTPS request:
sudo DEV_ENVIRONMENT=1 MANUFACTURING_SERVER_URL=https://localhost:8084 LOG_LEVEL=trace DIUN_PUB_KEY_ROOTCERTS=aio-dir/keys/diun_cert.pem ./target/debug/fdo-manufacturing-client
HTTP request:
sudo DEV_ENVIRONMENT=0 MANUFACTURING_SERVER_URL=http://localhost:8080 LOG_LEVEL=trace DIUN_PUB_KEY_ROOTCERTS=aio-dir/keys/diun_cert.pem ./target/debug/fdo-manufacturing-client
DI should work and create device_credentials file under /etc/device-credentials.