<?xml version="1.0" encoding="UTF-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xml:lang="en-US">
	<title>Angel's Blog</title>
	<link rel="alternate" type="text/html" href="https://angelcool.net/sphpblog/blog_index.php" />
	<modified>2026-05-13T17:57:14Z</modified>
	<author>
		<name>Angel</name>
	</author>
	<copyright>Copyright 2026, Angel</copyright>
	<generator url="http://www.sourceforge.net/projects/sphpblog" version="0.7.0">SPHPBLOG</generator>
	<entry>
		<title>SSL/TLS: Wildcard Certificate Generation</title>
		<link rel="alternate" type="text/html" href="https://angelcool.net/sphpblog/blog_index.php?entry=entry231116-031450" />
		<content type="text/html" mode="escaped"><![CDATA[Tested and working on 11/15/2023 ! <br /><br /><pre># Create root CA<br />[acool@localhost tls]$openssl req --x509 --nodes --days 3650 --newkey rsa:2048 --keyout ENT-CA.key --out ENT-CA.crt<br /><br /># Crate new key and signing request (Tip: remove --aes256 to remove passphrase requirement... I think)<br />Passphrase: mypassphrase<br />[acool@localhost tls]$openssl genrsa --out star-dev-localhost.key --aes256 2048<br />[acool@localhost tls]$openssl req --new --key star-dev-localhost.key --out star-dev-localhost.csr<br /><br /># Sign request<br />[acool@localhost tls]$openssl x509 --req --in star-dev-localhost.csr --CA ENT-CA.crt --CAkey ENT-CA.key --CAcreateserial --days 3650 --sha256 --extfile star-dev-localhost.cnf --out star-dev-localhost.crt<br /><br /># remove passphrase<br />[acool@localhost tls]$openssl rsa --in star-dev-localhost.key --out star-dev-localhost-nopassphrase.key<br /><br />[acool@localhost tls]$ cat star-dev-localhost.cnf <br />authorityKeyIdentifier = keyid,issuer<br />basicConstraints = CA:FALSE<br />keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment<br />subjectAltName = @alt_names<br /><br />[alt_names]<br />DNS.1 = *.dev.localhost<br />[acool@localhost tls]$<br />[acool@localhost tls]<br /><br /><br /># finally, import ENT-CA.crt certificate in Chrome<br /># chrome://settings/certificates</pre><br /><br />Configure Nginx:<br /><pre>...<br />listen 443 ssl;<br />ssl_certificate /etc/ssl/certs/star-dev-localhost.crt;<br />ssl_certificate_key /etc/ssl/certs/star-dev-localhost-nopassphrase.key;<br />...</pre>]]></content>
		<id>https://angelcool.net/sphpblog/blog_index.php?entry=entry231116-031450</id>
		<issued>2023-11-16T00:00:00Z</issued>
		<modified>2023-11-16T00:00:00Z</modified>
	</entry>
	<entry>
		<title>Generate wildcard TLS certificate with Let&#039;s Encrypt and Acme.sh</title>
		<link rel="alternate" type="text/html" href="https://angelcool.net/sphpblog/blog_index.php?entry=entry200804-224615" />
		<content type="text/html" mode="escaped"><![CDATA[// EXPORT DNS PROVIDER API KEYS<br />export GD_Key=&quot;XXXXXXXXX&quot;<br />export GD_Secret=&quot;YYYYYYYY&quot;<br /><br /><pre> # install acme.sh<br />[root@cia ~]#curl <a href="https://get.acme.sh" >https://get.acme.sh</a> | sh<br />...<br />[root@cia ~] # generate certificate<br />[root@cia ~] acme.sh --issue -d angelcool.net -d &#039;*.angelcool.net&#039; --dns dns_gd<br />[root@cia ~]<br />[root@cia ~] # install certificate where it can be read by nginx/apache server.<br />[root@cia ~] acme.sh --install-cert -d angelcool.net  --key-file /etc/pki/tls/certs/wildcard-angelcool.net.key  --fullchain-file /etc/pki/tls/certs/wildcard-angelcool.net.cert --reloadcmd &quot;service nginx force-reload&quot;<br />[root@cia ~]<br />[root@cia ~] # configure acme.sh auto upgrade<br />[root@cia ~] acme.sh --upgrade --auto-upgrade<br /></pre><br />Docs:<br /><a href="https://github.com/acmesh-official/acme.sh" >https://github.com/acmesh-official/acme.sh</a><br /><br />The script also adds an entry to crontab for auto renewal.<br /><br />Good luck!]]></content>
		<id>https://angelcool.net/sphpblog/blog_index.php?entry=entry200804-224615</id>
		<issued>2020-08-04T00:00:00Z</issued>
		<modified>2020-08-04T00:00:00Z</modified>
	</entry>
	<entry>
		<title>Nginx: Setting Up HTTP authentication</title>
		<link rel="alternate" type="text/html" href="https://angelcool.net/sphpblog/blog_index.php?entry=entry140508-172212" />
		<content type="text/html" mode="escaped"><![CDATA[Prompting users for a password before accessing a page.<br /><br />Place the following two entries in nginx configuration file:<br /><br /><pre>auth_basic &quot;Restricted&quot;;                                <br />auth_basic_user_file /var/www/mywebsite.com/.htpasswd;</pre><br />Eg:<br /><pre>  location / {<br />      root   /var/www/mywebsite.com;<br />      index  index.html index.htm;<br />      auth_basic &quot;Restricted&quot;;                                #For Basic Auth<br />      auth_basic_user_file /var/www/mywebsite.com/.htpasswd;  #For Basic Auth<br />  }</pre><br /><br />The .htpasswd must contain:<br />username:password<br /><br />Generate the password with this command:<br /><pre>[root@IBM ~]#printf &quot;USERNAME:$(openssl passwd -crypt PASSWORD)\n&quot; &gt;&gt; htpasswd</pre>]]></content>
		<id>https://angelcool.net/sphpblog/blog_index.php?entry=entry140508-172212</id>
		<issued>2014-05-09T00:00:00Z</issued>
		<modified>2014-05-09T00:00:00Z</modified>
	</entry>
</feed>
