<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: TheBishoyism</title>
    <description>The latest articles on DEV Community by TheBishoyism (@thebishoyism).</description>
    <link>https://dev.to/thebishoyism</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F705234%2Fd033f25c-f7ff-45e6-bd41-36541771bde2.jpeg</url>
      <title>DEV Community: TheBishoyism</title>
      <link>https://dev.to/thebishoyism</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/thebishoyism"/>
    <language>en</language>
    <item>
      <title>Add SSL to Jenkins on CentOS 8</title>
      <dc:creator>TheBishoyism</dc:creator>
      <pubDate>Tue, 14 Sep 2021 09:43:35 +0000</pubDate>
      <link>https://dev.to/thebishoyism/add-ssl-to-jenkins-on-centos-8-1gci</link>
      <guid>https://dev.to/thebishoyism/add-ssl-to-jenkins-on-centos-8-1gci</guid>
      <description>&lt;p&gt;Run Certbot to create a new certificate and a new private key on the Jenkins Machine and follow the steps inside the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo certbot certonly --standalone
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then run the following to extract the JKS (Java Key Store) file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;openssl pkcs12 -export -in /etc/letsencrypt/live/&amp;lt;yourdomainname&amp;gt;/fullchain.pem -inkey /etc/letsencrypt/live/&amp;lt;yourdomainname&amp;gt;/privkey.pem -out /var/lib/jenkins/.ssl/certificate.p12 -name "certificate"

keytool -importkeystore -srckeystore certificate.p12 -srcstoretype pkcs12 -destkeystore cert.jks
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a folder inside /var/lib/jenkins and call it ".ssl":&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir /var/lib/jenkins/.ssl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy the JKS file into the .ssl folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cp cert.jks /var/lib/jenkins/.ssl/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Change the mode and owner of the JKS file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd /var/lib/jenkins/
chmod 700 .ssl/cert.jks
chown -R jenkins:jenkins .ssl/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Edit the following in the /etc/sysconfig/jenkins file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;JENKINS_HTTPS_PORT="8443"
JENKINS_HTTPS_KEYSTORE="/var/lib/jenkins/.ssl/cert.jks"
JENKINS_HTTPS_KEYSTORE_PASSWORD="&amp;lt;your passkey here&amp;gt;"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;then reroute port 443 to port 8443:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;firewall-cmd --zone=public --add-service=https
firewall-cmd --add-forward-port=port=443:proto=tcp:toport=8443
firewall-cmd --runtime-to-permanent
firewall-cmd --reload
firewall-cmd --list-all
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>jenkins</category>
      <category>ssl</category>
      <category>certbot</category>
      <category>centos</category>
    </item>
    <item>
      <title>How To Install Certbot on CentOS 8</title>
      <dc:creator>TheBishoyism</dc:creator>
      <pubDate>Mon, 13 Sep 2021 15:06:53 +0000</pubDate>
      <link>https://dev.to/thebishoyism/how-to-install-certbot-on-centos-8-2hco</link>
      <guid>https://dev.to/thebishoyism/how-to-install-certbot-on-centos-8-2hco</guid>
      <description>&lt;ul&gt;
&lt;li&gt;First, install snapd on CentOS 8
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo dnf install epel-release
sudo dnf upgrade
sudo yum install snapd
sudo systemctl enable --now snapd.socket
sudo ln -s /var/lib/snapd/snap /snap
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Installing Certbot:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  - To run Certbot:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo certbot certonly --standalone
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Then follow the instructions to create a certificate for your domain name&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ssl</category>
      <category>certbot</category>
      <category>letsencrypt</category>
      <category>centos</category>
    </item>
  </channel>
</rss>
