apache - Trouble getting a self-signed cert working in Postman -
i'm not sure stack community belongs in, hoping can me out.
i'm getting using ssl on personal sites, started trying make multi-domain self signed cert local development (to handle api.mydomain.local, www.mydomain.local, , mydomain.local). don't know if first mistake, but...
as couldn't find single encompassing guide, started using 2 tutorials (from easyengine , developerside) create cert , install on host (win10). used digitalocean guide figure out how setup apache on dev server (a ubuntu vm); there, no big trouble, other minor issues caused working multiple guides @ same time.
i go ahead , try hit api in chrome, gives me untrusted certificate value expected, pass , works. far know, means cert worked? however, when try hit api in postman, error indicates can't accept untrusted cert, fine, has tutorial on how fix that. however, still doesn't work. can't figure out else fix this, , i'm hoping can advise me... on right track? cert borked? did make core mistake in trying multi-domain cert?
one thing did notice in dev tools security tab, says
subject alternative name missing so i'm not sure if means alt names aren't working, if weren't, wouldn't try load certificate when hit in chrome, right?
i had similar issue while writing article website on ssl certificates. wrote shell script same
#!/bin/bash cert_company_name=${cert_company_name:=tarun lalwani} cert_country=${cert_country:=in} cert_state=${cert_state:=delhi} cert_city=${cert_city:=delhi} cert_dir=${cert_dir:=certs} root_cert=${root_cert:=rootca.pem} root_cert_key=${root_cert_key:=rootca.key.pem} # make directories work mkdir -p $cert_dir create_root_cert(){ # create own root certificate authority openssl genrsa \ -out $cert_dir/$root_cert_key \ 2048 # self-sign root certificate authority # since private, details can bogus openssl req \ -x509 \ -new \ -nodes \ -key ${cert_dir}/$root_cert_key \ -days 1024 \ -out ${cert_dir}/$root_cert \ -subj "/c=$cert_country/st=$cert_state/l=$cert_city/o=$cert_company_name signing authority/cn=$cert_company_name signing authority" } create_domain_cert() { local fqdn=$1 local filename=${fqdn/\*/wild} # create device certificate each domain, # such example.com, *.example.com, awesome.example.com # note: must match cn domain name or ip address want use openssl genrsa \ -out $cert_dir/${filename}.key \ 2048 # create request device, root ca sign if [[ ! -z "${san}" ]]; openssl req -new \ -key ${cert_dir}/${filename}.key \ -out ${cert_dir}/${filename}.csr \ -subj "/c=${cert_country}/st=${cert_state}/l=${cert_city}/o=$cert_company_name/cn=${fqdn}" \ -reqexts san_env -config <(cat /etc/ssl/openssl.cnf <(cat ./openssl-san.cnf)) else openssl req -new \ -key ${cert_dir}/${filename}.key \ -out ${cert_dir}/${filename}.csr \ -subj "/c=${cert_country}/st=${cert_state}/l=${cert_city}/o=$cert_company_name/cn=${fqdn}" fi # sign request device root ca if [[ ! -z "${san}" ]]; openssl x509 \ -sha256 \ -req -in $cert_dir/${filename}.csr \ -ca $cert_dir/$root_cert \ -cakey $cert_dir/$root_cert_key \ -cacreateserial \ -out $cert_dir/${filename}.crt \ -days 500 \ -extensions san_env \ -extfile openssl-san.cnf else openssl x509 \ -sha256 \ -req -in $cert_dir/${filename}.csr \ -ca $cert_dir/$root_cert \ -cakey $cert_dir/$root_cert_key \ -cacreateserial \ -out $cert_dir/${filename}.crt \ -days 500 fi } method=$1 args=${*:2} echo "called $method , $args" if [ -z "${method}" ]; echo "usage ./sslcerts.sh [create_root_cert|create_domain_cert] <args>" echo "below environment variabls can use:" echo "cert_company_name=company name" echo "cert_country=country" echo "cert_state=state" echo "cert_city=city" echo "cert_dir=directory certificate needs genereated" echo "root_cert=name of root cert" echo "root_cert_key=name of root certificate key" else ${method} ${args} fi you can change environment variables on top , generate self-signed certificate using below
$ san=dns.1:*.tarunlalwani.com,dns.2:tarunlalwani.com ./sslcerts.sh create_domain_cert '*.tarunlalwani.com' edit 1
earlier browsers use rely on fqdn, of them have started using san "subject alternative name". openssl doesn't come v3 extensions configured. san part of v3 extensions. when generated self signed certificated has correct fqdn (full qualified domain name) not san. chrome show error these certificates see firefox working fine.
ps: taken article http://tarunlalwani.com/post/self-signed-certificates-trusting-them/
Comments
Post a Comment