# How to secure access to Minio server with TLS [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io)
# How to secure access to Minio server with TLS [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io)
In this document, we will configure Minio servers with TLS certificates for both Linux and Windows.
This document explains how to configure Minio server with TLS certificates on Linux and Windows platforms.
## 1. Prerequisites
## 1. Prerequisites
* Download Minio server from [here](https://docs.minio.io/docs/minio-quickstart-guide)
Download Minio server from [here](https://docs.minio.io/docs/minio-quickstart-guide)
## 2. Configure with existing certificates
## 2. Existing certificates
Assuming that you are already having private and public certificates, you will need to copy them under `certs` in your Minio config directory using the names `private.key` and `public.crt` for key and public certificates respectively.
If you have already acquired private keys and public certificates, copy them under `certs` directory in your Minio config directory. By default config directory is `${HOME}/.minio/` or `%%USERPROFILE%%\.minio\` (based on your operating system). Note that the file should be named as `private.key` and `public.crt` for key and certificate respectively.
If the certificate is signed by a certificate authority, `public.crt` should be the concatenation of the server's certificate, any intermediates, and the CA's root certificate.
If the certificate is signed by a certificate authority (CA), `public.crt` should be the concatenation of the server's certificate, any intermediates, and the CA's root certificate.
## 3. Generate certificates
If you're looking to generate CA certificate for Minio using Let's Encrypt, follow the docs [here](https://docs.minio.io/docs/generate-let-s-encypt-certificate-using-concert-for-minio).
### Linux
## 3. Generate self-signed certificates
Minio supports only key/certificate in PEM format on Linux.
Before generating your self-signed certificate, note that
#### With Let's Encrypt
- Minio supports only key/certificate in PEM format on Linux.
- Minio supports only key/certificate in PEM format on Windows. We don't support PFX certificates currently.
#### With generate_cert.go (self-signed certificate)
Download [generate_cert.go](https://golang.org/src/crypto/tls/generate_cert.go?m=text). This is a simple go tool to generate self-signed certificates.
You need to download [generate_cert.go](https://golang.org/src/crypto/tls/generate_cert.go?m=text) which is a simple go tool for generating self-signed certificates but works for the most of cases.
`generate_cert.go` already provides SAN certificates with DNS and IP entries:
`generate_cert.go` already provides SAN certificates with DNS and IP entries:
@ -32,7 +31,7 @@ You need to download [generate_cert.go](https://golang.org/src/crypto/tls/genera
go run generate_cert.go -ca --host "10.10.0.3"
go run generate_cert.go -ca --host "10.10.0.3"
```
```
#### With OpenSSL:
### Using OpenSSL
Generate the private key:
Generate the private key:
@ -46,11 +45,38 @@ Generate the self-signed certificate:
Create a file called `openssl.conf` and add the below text in the file. Note that you'll need to change the `IP.1` field to point to correct IP address.
```sh
[req]
distinguished_name = req_distinguished_name
x509_extensions = v3_req
prompt = no
[req_distinguished_name]
C = US
ST = VA
L = Somewhere
O = MyOrg
OU = MyOU
CN = MyServerName
[v3_req]
subjectAltName = @alt_names
[alt_names]
IP.1 = 127.0.0.1
```
Then run
Minio only supports key/certificate in PEM format on Windows. Currently we do not yet support PFX certificates.
Minio can be configured to connect to other servers, whether Minio nodes or servers like NATs, Redis. If these servers use certificates that are not registered in one of the known certificates authorities, you can make Minio server trust these CAs by dropping these certificates under Minio config path (`~/.minio/certs/CAs/` on Linux or `C:\Users\<Username>\.minio\certs\CAs` on Windows).
Minio can be configured to connect to other servers, whether Minio nodes or servers like NATs, Redis. If these servers use certificates that are not registered in one of the known certificates authorities, you can make Minio server trust these CAs by dropping these certificates under Minio config path (`~/.minio/certs/CAs/` on Linux or `C:\Users\<Username>\.minio\certs\CAs` on Windows).