---
# System prepended metadata

title: OpenSSL
tags: [OpenSSL, Application]

---

:::info
For Internal Use Only–Not for Pubic Distribution.
:::

> [name=Anthony Ho, MUS Applications Engineer]
###### tags: `OpenSSL` `Application`

# OpenSSL

This document will demonstrate how to import a certifcate generated with OpenSSL onto a NPort 6000 Series.

Download and install `Win64 OpenSSL v1.1.1c` from [OpenSSL](https://slproweb.com/products/Win32OpenSSL.html).

```shell
$ cd 'C:\Program Files\OpenSSL-Win64\bin\'
```

In the bin directory, perform the following commands:

### Generate CA (Root Certificate)
```shell
$ mkdir root
$ ./openssl req -x509 -newkey rsa:4096 -keyout root/root.pem -out root/root.crt -days 3650 -nodes
```

![](https://i.imgur.com/OxydOpl.png)


### Generate Server Certificate (NPort 6000 Series)
```shell
$ mkdir server1
$ ./openssl.exe req -newkey rsa:4096 -keyout server1/server1.pem -out server1/server1.csr -days 3650 -nodes
```
:::warning
Common Name is the device's IP address.
:::
![](https://i.imgur.com/GEDA6OE.png)

### Create an x509 v3 User Certificate
```typescript=
authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names
[alt_names]
IP.1 = 192.168.115.84
```
:::warning
Change IP.1 to your device's IP address and save the file as "v3.ext" to the bin directory.
:::

### Sign Certificate
```shell
$ ./openssl.exe x509 -req -in server1/server1.csr -CA root/root.crt -CAkey root/root.pem -CAcreateserial -out server1/server1.crt -days 3650 -extfile v3.ext
```
![](https://i.imgur.com/VU62eqt.png)

### Create the PEM file
Merge the contents of ```server1.crt``` and ```server1.pem``` into a new file (I named it```nport.pem```) and save it into ```/bin/server1/```.

```shell
$ cat .\server1\server1.crt, .\server1\server1.pem | sc .\server1\nport.pem
```

#### nport.pem
```typescript
-----BEGIN CERTIFICATE-----
MIIFkzCCA3ugAwIBAgIUdT9K6snuUl+UnNF1wFeMk8gswUMwDQYJKoZIhvcNAQEL
BQAwWDELMAkGA1UEBhMCVVMxCzAJB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a5+0ia2jNtrjhyibPAY5I7JHMqWMCcvVRCMtpeD
d01IqkcjxIi5edc3QeZjc6A383oD3FHSKawQNlECggEAFO1LTtJyVceWIbZ2GQx5
N2q612Nh8i0CWVHYAR4TcTuO2x3gGCx1n1qoMoDYNRq8KP3Ysy+nfNWE7Or9zXtC
twAB8oaIAjb3WVwE2ZtONLN+rK2EWVSPUhAlNm/8xvFsGUJ4lLGYv5WfUDjHJkfd
qWscXNjgBEux4saUVo4sEOg1vtaAyHAnCjeIuAsS1HxG4XHVTPsaoCBQO+xO5pNk
mZuOp6KBHaK4MFBiIsknxP3QXB0wBe/T11X107c3Yz1Tk9TlEsEB87DWJpaphOpt
cxs3WuVma33m1VZr1pENFCqgtLFChyh7fdiJJPGTOmSZw4271Auebx0RD+lkgKTo
OQKCAQAlvKeyA5uSdp2kPpGoGwIzZRWZaBVpo1elfDPuRyuZvABLARpRU2rs8Pbs
PevqhLgeFN1FUZW2JIWIkIyh3dscoV3QOr3Rgjycexse3VUXza/4U9KBKflctCtg
rJ5Zloo5qkqyAJglHLrnw3JXZ7pk8HCXCFuDmgWeyRvJwuvQSwczyCTRrQqdMPq9
ba+JJG0XlKBMQP7mWhYn5aX/att4+5eK8Id7gxo+HQ0xldBBvFONa85XgjBidn5r
edOsJIcLLYyFE4swh/PNxy6D8Zt0mBB8VOM0wWNViPgiKskwu7P3aoGT9KmA0fzC
zWnBUxsswH+SeBSZGFwu/pvqct90
-----END PRIVATE KEY-----

```

Upload this PEM file to your device.

![](https://i.imgur.com/zUQcbKt.png)


### Import Root Certificate

Open your browser and import `root.crt` to the Trusted Root Certification Authorities from the `/bin/root/` directory.

![](https://i.imgur.com/7CWqbbI.png)

### Verify HTTPS

![](https://i.imgur.com/xV47Pcw.png)

![](https://i.imgur.com/nEhgLBs.png)
