Hướng dẫn tạo certificate SSL trên ubuntu (file key, pem)

3801

Bài viết được sự cho phép của tác giả Trần Hữu Cương

Hướng dẫn tạo certificate SSL trên ubuntu (file key, pem)

(Xem thêm: Hướng dẫn tạo certificate SSL trên Windows (file key, pem))

Với server chạy bằng Java bạn cần chuyển file pem, private key sang p.12 (PKCS#12)

  System Design Cơ Bản: HTTPS, SSL, AND TLS
  Xử lý SSL Certificate trong Selenium WebDriver

Tạo file .key

openssl genrsa -out {ten_file}.key {do_dai_key}

Ví dụ:

openssl genrsa -out cert.key 2048

Hướng dẫn tạo certificate SSL trên ubuntu (file key, pem)

Tạo file .pem từ file .key

Cú pháp:

openssl req -x509 -new -nodes -key {ten_file.key} -sha256 -days 1825 -out {ten_file.pem}

Ví dụ:

openssl req -x509 -new -nodes -key cert.key -sha256 -days 1825 -out cert.pem

Sau đó nhập các thông tin của certificate như  email, name…

Bạn cũng có thể tạo file .crt, chỉ cần đổi đuôi .pem thành đuôi .crt là được

Demo:

Đây là thông tin SSL Certificate hiển thị trên trình duyệt khi mình dùng 2 file trên apply cho website của mình:

Hướng dẫn tạo certificate SSL trên ubuntu (file key, pem)

(Xem thêm: Cấu hình HTTPs cho Server NGINX)

Hướng dẫn tạo certificate SSL trên ubuntu (file key, pem)

Okay, Done!

References:

Bài viết gốc được đăng tải tại stackjava.com

Có thể bạn quan tâm:

Xem thêm Việc làm Developer hấp dẫn trên TopDev