<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title>Angel's Blog</title>
		<link>https://angelcool.net/sphpblog/blog_index.php</link>
		<description><![CDATA[No Footer]]></description>
		<copyright>Copyright 2026, Angel</copyright>
		<managingEditor>Angel</managingEditor>
		<language>en-US</language>
		<generator>SPHPBLOG 0.7.0</generator>
		<item>
			<title>SSL/TLS: Wildcard Certificate Generation</title>
			<link>https://angelcool.net/sphpblog/blog_index.php?entry=entry231116-031450</link>
			<description><![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>]]></description>
			<category>- Nginx Notes</category>
			<guid isPermaLink="true">https://angelcool.net/sphpblog/blog_index.php?entry=entry231116-031450</guid>
			<author>Angel</author>
			<pubDate>Thu, 16 Nov 2023 03:14:50 GMT</pubDate>
		</item>
		<item>
			<title>Generate wildcard TLS certificate with Let&#039;s Encrypt and Acme.sh</title>
			<link>https://angelcool.net/sphpblog/blog_index.php?entry=entry200804-224615</link>
			<description><![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!]]></description>
			<category>- Nginx Notes</category>
			<guid isPermaLink="true">https://angelcool.net/sphpblog/blog_index.php?entry=entry200804-224615</guid>
			<author>Angel</author>
			<pubDate>Tue, 04 Aug 2020 22:46:15 GMT</pubDate>
		</item>
		<item>
			<title>Nginx: Setting Up HTTP authentication</title>
			<link>https://angelcool.net/sphpblog/blog_index.php?entry=entry140508-172212</link>
			<description><![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>]]></description>
			<category>- Nginx Notes</category>
			<guid isPermaLink="true">https://angelcool.net/sphpblog/blog_index.php?entry=entry140508-172212</guid>
			<author>Angel</author>
			<pubDate>Fri, 09 May 2014 00:22:12 GMT</pubDate>
		</item>
	</channel>
</rss>
