Tips and tricks

How to generate ssl certificate for localhost

… or self generate ssl certificate

First, we need to create this configuration in your ~/Certificates

[req]
default_bits = 1024
distinguished_name = req_distinguished_name
req_extensions = v3_req

[req_distinguished_name]

[v3_req]
basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
subjectAltName = @alt_names

[alt_names]
DNS.1 = localhost

then, enter

sudo openssl

you can write these commands:

genrsa -out /Users/raduh/Certificates/dzsvideogallery.key 2048
rsa -in /Users/raduh/Certificates/dzsvideogallery.key -out /Users/raduh/Certificates/dzsvideogallery.key.rsa
req -new -key /Users/raduh/Certificates/dzsvideogallery.key.rsa -subj /CN=dzsvideogallery.me -out /Users/raduh/Certificates/dzsvideogallery.csr -config /Users/raduh/Certificates/localhost.conf
x509 -req -extensions v3_req -days 3650 -in /Users/raduh/Certificates/dzsvideogallery.csr -signkey /Users/raduh/Certificates/dzsvideogallery.key.rsa -out /Users/raduh/Certificates/dzsvideogallery.crt -extfile /Users/raduh/Certificates/localhost.conf

then, exit and enter:

sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain /Users/raduh/Certificates/dzsvideogallery.crt

you can then add it to your nginx.conf

{"type":"main_options","images_arr":"'#ffffff'","enable_ajax":"off","soundcloud_apikey":"","bg_isparallax":"off","bg_slideshow_time":"0","bg_transition":"slidedown","site_url":"https:\/\/digitalzoomstudio.net","theme_url":"https:\/\/digitalzoomstudio.net\/wp-content\/themes\/qucreative\/","blur_ammount":"26","width_column":"50","width_section_bg":"","width_gap":"30","border_width":"0","border_color":"#ffffff","translate_cancel_comment":"Cancel reply","translate_leave_a_comment":"Leave a comment","translate_leave_a_comment_to":"Leave a comment to","is_customize_preview":"off","width_blur_margin":"30","gallery_w_thumbs_autoplay_videos":"off","content_enviroment_opacity":"30","menu_enviroment_opacity":"70","base_url":"https:\/\/digitalzoomstudio.net"}
{"type":"darkfull"}