Junjao

Programming, Software Engineering

SSL ด้วย openSSL สิงหาคม 11, 2011

Filed under: Uncategorized — จั่น @ 5:01 pm

1) ที่ Linux

#yum install mod_ssl เพื่อที่จะได้คำสั่ง openssl

 

 

แบบ Self-Signed
=============
2)Create a RSA private key for your server (will be Triple-DES encrypted and PEM formatted):
$ openssl genrsa -des3 -out server.key 1024

3) Create a self-signed Certificate (X509 structure) with the RSA key you just created (output will be PEM formatted):

$ openssl req -new -x509 -nodes -sha1 -days 365 -key server.key -out server.crt

*****จากนั้นนำ server.key กับ server.crt ไปใช้งาน โดยระบุใน apache configuration file (ssl.conf)

 

 

แบบส่ง Public key ไป Sign กับ ROOT CA  (cacert.org)

===========================

2) Create a RSA private key for your Apache server (will be Triple-DES encrypted and PEM formatted):

$ openssl genrsa -des3 -out server.key 1024

3) Create a Certificate Signing Request (CSR) with the server RSA private key (output will be PEM formatted):

$ openssl req -new -key server.key -out server.csr

เมื่อได้ไฟล์ server.csr แล้วจึงนำไปสร้าง Certificate ที่ website cacert.org   จะได้เนื้อหาของไฟล์ server.crt 

****จากนั้นนำ server.key กับ server.crt ไปใช้งาน โดยระบุใน apache configuration file (ssl.conf)

****ข้อจำกัดคือจะได้ Certificate ที่มีอายุเพียง 6 เดือน

 

 

อ้างอิง

http://httpd.apache.org/docs/2.0/ssl/ssl_faq.html

http://www.cacert.org

 

ใส่ความเห็น

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / เปลี่ยนแปลง )

Twitter picture

You are commenting using your Twitter account. Log Out / เปลี่ยนแปลง )

Facebook photo

You are commenting using your Facebook account. Log Out / เปลี่ยนแปลง )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.