Skip to content

Commit 4ba2f13

Browse files
committed
chore(tls): add tls support documentation
1 parent dab850e commit 4ba2f13

File tree

3 files changed

+25
-13
lines changed

3 files changed

+25
-13
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22

33
<Empty>
44

5+
<a name="v0.2.0"></a>
6+
## v0.2.0 (2021-04-19)
7+
8+
> Requires Rust: rustc 1.49.0 (e1884a8e3 2020-12-29)
9+
10+
#### Features
11+
12+
* Add support for HTTPS serving using TLS
13+
* Support TLS certificates
14+
* Support TLS keys using RSA or PKCS8 algorithm
15+
16+
#### Improvements
17+
18+
* Refactor CLI implementation to use _structopt_
19+
520
<a name="v0.1.0"></a>
621
## v0.1.0 (2021-04-02)
722

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ http-server --help
3333
## Usage
3434

3535
```
36-
http-server [FLAGS] [OPTIONS] [root_dir]
36+
http-server [FLAGS] [OPTIONS] [root-dir]
3737
```
3838

3939
### Flags
@@ -64,9 +64,9 @@ Host | `-h` | `--host` | Address to bind the server | `127.0.0.1`
6464
Port | `-p` | `--port` | Port to bind the server | `7878`
6565
Configuration File | `-c` | `--config` | Specifies a configuration file. [Example](https://github.com/EstebanBorai/http-server/blob/main/fixtures/config.toml) | N/A
6666
TLS | N/A | `--tls` | Enable TLS for HTTPS connections. Requires a Certificate and Key. [Reference](#tls-reference) | N/A
67-
TLS Ceritificate | N/A | `--tls_cert` | Path to TLS certificate file. **Depends on `--tls`** | `cert.pem`
68-
TLS Key | N/A | `--tls_key` | Path to TLS key file. **Depends on `--tls`** | `key.rsa`
69-
TLS Key Algorithm | N/A | `--tls_key_alg` | Algorithm used to generate certificate key. **Depends on `--tls`** | `rsa`
67+
TLS Ceritificate | N/A | `--tls-cert` | Path to TLS certificate file. **Depends on `--tls`** | `cert.pem`
68+
TLS Key | N/A | `--tls-key` | Path to TLS key file. **Depends on `--tls`** | `key.rsa`
69+
TLS Key Algorithm | N/A | `--tls-key-algorithm` | Algorithm used to generate certificate key. **Depends on `--tls`** | `rsa`
7070

7171
## References
7272

@@ -89,7 +89,7 @@ This script relies on `openssl`, so make sure you have it installed in your syst
8989
Run `http-server` as follows:
9090

9191
```sh
92-
http-server --tls --tls_cert <PATH TO YOUR CERTIFICATE> --tls_key <PATH TO YOUR KEY> --tls_key_alg pkcs8
92+
http-server --tls --tls-cert <PATH TO YOUR CERTIFICATE> --tls-key <PATH TO YOUR KEY> --tls-key-algorithm pkcs8
9393
```
9494

9595
## Release

src/cli.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use crate::config::util::tls::PrivateKeyAlgorithm;
1212
)]
1313
pub struct Cli {
1414
/// Path to TOML configuration file.
15-
/// https://github.com/EstebanBorai/http-server/blob/main/fixtures/config.toml
1615
#[structopt(parse(from_os_str), short = "c", long = "config")]
1716
pub config: Option<PathBuf>,
1817
/// Host (IP) to bind the server
@@ -27,18 +26,16 @@ pub struct Cli {
2726
/// Turns on stdout/stderr logging
2827
#[structopt(short = "v", long = "verbose")]
2928
pub verbose: bool,
30-
/// Enables HTTPS serving using TLS. Requires a Certificate and a Key
31-
/// provided with the `tls_cert` and `tls_key` options
29+
/// Enables HTTPS serving using TLS
3230
#[structopt(long = "tls")]
3331
pub tls: bool,
3432
/// Path to the TLS Certificate
35-
#[structopt(long = "tls_cert", parse(from_os_str), default_value = "cert.pem")]
33+
#[structopt(long = "tls-cert", parse(from_os_str), default_value = "cert.pem")]
3634
pub tls_cert: PathBuf,
3735
/// Path to the TLS Key
38-
#[structopt(long = "tls_key", parse(from_os_str), default_value = "key.rsa")]
36+
#[structopt(long = "tls-key", parse(from_os_str), default_value = "key.rsa")]
3937
pub tls_key: PathBuf,
40-
/// Algorithm used to generate certificate key. Supports RSA (rsa) and
41-
/// PKCS8 (pkcs8)
42-
#[structopt(long = "tls_key_algorithm", default_value = "rsa")]
38+
/// Algorithm used to generate certificate key
39+
#[structopt(long = "tls-key-algorithm", default_value = "rsa")]
4340
pub tls_key_algorithm: PrivateKeyAlgorithm,
4441
}

0 commit comments

Comments
 (0)