Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ install:
${MKDIR_P} /usr/local/bin

@# Install binary
install -m 0755 bin/ca-gen /usr/local/bin/ca-gen
install -m 0755 bin/cert-gen /usr/local/bin/cert-gen
install -m 0755 bin/ca-gen ~/.local/bin/ca-gen
install -m 0755 bin/cert-gen ~/.local/bin/cert-gen
install -m 0755 bin/cert-gen ~/.local/bin/configs
Comment on lines +56 to +58
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a non-default location for binaries.

You should use:

sudo make install



@echo "Installation complete:"
Expand Down
68 changes: 50 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,46 +15,73 @@ All subsequent created certificates will then be valid SSL certificates to each
**Table of Contents**

1. [Available Tools](#available-tools)
1. [Tools](#tools)
2. [Requirements](#requirements)
3. [Installation](#installation)
1. [Tools](#tools)
2. [Requirements](#requirements)
3. [Installation](#installation)
2. [Create Certificate Authoriy](#create-certificate-authority)
1. [Usage: ca-gen](#usage-ca-gen)
2. [Execute: ca-gen](#execute-ca-gen)
3. [Example: CA](#example-ca)
1. [Configuration](#config)
2. [Usage: ca-gen](#usage-ca-gen)
3. [Execute: ca-gen](#execute-ca-gen)
4. [Example: CA](#example-ca)
3. [Create SSL Certificate](#create-ssl-certificate)
1. [Usage: cert-gen](#usage-cert-gen)
2. [Execute: cert-gen](#execute-cert-gen)
3. [Example: SSL certificate](#example-ssl-certificate)
1. [Usage: cert-gen](#usage-cert-gen)
2. [Execute: cert-gen](#execute-cert-gen)
3. [Example: SSL certificate](#example-ssl-certificate)
4. [Import CA into Chrome](#import-ca-into-chrome)
5. [License](#license)

----
---

## Available Tools

#### Tools

| Tools | Description |
|--------------------------|-------------|
| [ca-gen](bin/ca-gen) | Creates a certificate authority |
| Tools | Description |
| ------------------------ | ---------------------------------------------------------- |
| [ca-gen](bin/ca-gen) | Creates a certificate authority |
| [cert-gen](bin/cert-gen) | Creates SSL certificates signed by a certificate authority |

#### Requirements

* `openssl`
* `bash`
- `openssl`
- `bash`

#### Installation

```bash
$ sudo make install
```

#### Configuration

#### config

update the following file(~/.local/bin/configs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, not a default location


```bash
# Generate default options
DEF_KEYSIZE=4096
DEF_DAYS=3650
DEF_SIGN_SIGNATURE="sha256"
# Subject default options
DEF_COUNTRY=MU
DEF_STATE=GP
DEF_CITY=Mahebourg
DEF_ORG=Tricky-bit
DEF_UNIT=IT
DEF_CN=tricky-bit.int
[email protected]
# v3 subject alt names
DEF_ALT_NAME=trick-bit.int
DEF_ALT_IP_NAME=
```

## Create Certificate Authority

#### Usage: ca-gen

The following shows the general usage for `ca-gen`:

```bash
USAGE: ca-gen -n CN [-kdcslouev] <keyfile> <crtfile>
ca-gen --help
Expand All @@ -80,13 +107,16 @@ Required parameter
```

#### Execute: ca-gen

The following command shows how the CA is generated for the [Devilbox](https://github.com/cytopia/devilbox):

```bash
$ ca-gen -v -c DE -s Berlin -l Berlin -o Devilbox -u Devilbox -n devilbox.org \
-e [email protected] devilbox-rootCA.key devilbox-rootCA.crt
```

#### Example: CA

```bash
Certificate:
Data:
Expand Down Expand Up @@ -152,11 +182,12 @@ Certificate:
3e:3e:85:09
```


## Create SSL Certificate

#### Usage: cert-gen

The following shows the general usage for cert-gen:

```bash
USAGE: cert-gen -n CN [-kdcsloueav] <ca-key> <ca-crt> <key> <csr> <crt>
cert-gen --help
Expand Down Expand Up @@ -187,7 +218,9 @@ Required parameter
```

#### Execute: cert-gen

The following command shows how SSL certificates are generated for the [Devilbox](https://github.com/cytopia/devilbox):

```bash
$ cert-gen -v -c DE -s Berlin -l Berlin -o Devilbox -u Devilbox \
-n project.loc -e [email protected] \
Expand All @@ -200,6 +233,7 @@ $ cert-gen -v -c DE -s Berlin -l Berlin -o Devilbox -u Devilbox \
```

#### Example: SSL Certificate

```bash
Certificate:
Data:
Expand Down Expand Up @@ -269,7 +303,6 @@ Certificate:
b6:1a:14:ab
```


## Import CA into Chrome

**1. Open Chrome settings - scroll down and click `Advanced`**
Expand All @@ -292,7 +325,6 @@ Certificate:

<img width="600" style="width:600px;" src="img/05-set-trust.png" />


## License

[MIT License](LICENSE.md)
24 changes: 12 additions & 12 deletions bin/ca-gen
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ set -o pipefail
NAME="ca-gen"

# Generate default options
DEF_KEYSIZE=2048
DEF_DAYS=3650
DEF_SIGN_SIGNATURE="sha256"
# Subject default options
DEF_COUNTRY=
DEF_STATE=
DEF_CITY=
DEF_ORG=
DEF_UNIT=
DEF_CN=
DEF_EMAIL=

# DEF_KEYSIZE=2048
# DEF_DAYS=3650
# DEF_SIGN_SIGNATURE="sha256"
# # Subject default options
# DEF_COUNTRY=MU
# DEF_STATE=GP
# DEF_CITY=Mahebourg
# DEF_ORG=Tricky-bit
# DEF_UNIT=IT
# DEF_CN=tricky-bit.int
# DEF_EMAIL=[email protected]
source ~/.local/bin/configs
# Verbosity
DEF_VERBOSE=

Expand Down
28 changes: 14 additions & 14 deletions bin/cert-gen
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ set -o pipefail
NAME="cert-gen"

# Generate default options
DEF_KEYSIZE=2048
DEF_DAYS=825
DEF_SIGN_SIGNATURE="sha256"
# Subject default options
DEF_COUNTRY=
DEF_STATE=
DEF_CITY=
DEF_ORG=
DEF_UNIT=
DEF_CN=
DEF_EMAIL=
# DEF_KEYSIZE=2048
# DEF_DAYS=825
# DEF_SIGN_SIGNATURE="sha256"
# # Subject default options
# DEF_COUNTRY=MU
# DEF_STATE=GP
# DEF_CITY=Mahebourg
# DEF_ORG=Tricky-Bit
# DEF_UNIT=IT
# DEF_CN=tricky-bit.int
# DEF_EMAIL=[email protected]

# v3 subject alt names
DEF_ALT_NAME=
DEF_ALT_IP_NAME=

# DEF_ALT_NAME=trick-bit.int
# DEF_ALT_IP_NAME=
source ~/.local/bin/configs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if this file does not exist?

# Verbosity
DEF_VERBOSE=

Expand Down
17 changes: 17 additions & 0 deletions bin/configs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generate default options
DEF_KEYSIZE=4096
DEF_DAYS=3650
DEF_SIGN_SIGNATURE="sha256"
# Subject default options
DEF_COUNTRY=MU
DEF_STATE=GP
DEF_CITY=Mahebourg
DEF_ORG=Tricky-bit
DEF_UNIT=IT
DEF_CN=tricky-bit.int
[email protected]
# v3 subject alt names
DEF_ALT_NAME=trick-bit.int
DEF_ALT_IP_NAME=