<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by John Mark Tagle on Medium]]></title>
        <description><![CDATA[Stories by John Mark Tagle on Medium]]></description>
        <link>https://medium.com/@johnmarktagle?source=rss-f15b13b96407------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*D-L73TsgK_U_SS0MQVsmYQ.png</url>
            <title>Stories by John Mark Tagle on Medium</title>
            <link>https://medium.com/@johnmarktagle?source=rss-f15b13b96407------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 22:23:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@johnmarktagle/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Using self-signed SSL in Android (Nougat+)]]></title>
            <link>https://medium.com/@johnmarktagle/using-self-signed-ssl-in-android-nougat-6d59593a3b6f?source=rss-f15b13b96407------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d59593a3b6f</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[John Mark Tagle]]></dc:creator>
            <pubDate>Tue, 17 Jan 2017 07:13:30 GMT</pubDate>
            <atom:updated>2017-01-17T07:16:50.817Z</atom:updated>
            <content:encoded><![CDATA[<p>Since the introduction of Nougat (API 24) to Android, a number of changes were introduces on how Android handles trusted certificate authorities (CAs). Before, one only needs to install the self-signed SSL .cer file in the emulator/device Security Settings. Then the app will just simply be able to access your secure endpoints (HTTPS) using the global device settings.</p><p><strong><em>Now, apps that target API Level 24 and above no longer trust user or admin-added CAs for secure connections, by default.</em></strong></p><p>You need to do some additional steps for your app to gain access to the trusted CAs.</p><h3><strong>1. Convert your .CER file to .PEM file</strong></h3><p>This is the command to convert the file using the terminal.</p><blockquote><strong>openssl x509 -inform pem -in &lt;sslcert.cer&gt; -outform der -out &lt;sslcert.pem&gt;</strong></blockquote><p>After you have converted the CER file to PEM, import the PEM file in your res/raw folder.</p><h3>2. Add a Network Security Config</h3><p>Create a network_security_config.xml file in y0ur /res/xml folder. Point it to the imported PEM file.</p><blockquote><strong>&lt;?xml version=”1.0&quot; encoding=”utf-8&quot;?&gt;<br> &lt;network-security-config&gt;<br> &lt;base-config&gt;<br> &lt;trust-anchors&gt;<br> &lt;certificates src=”</strong><a href="http://twitter.com/raw/spcert"><strong>@raw/sslcert</strong></a><strong>”/&gt;<br> &lt;certificates src=”system”/&gt;<br> &lt;/trust-anchors&gt;<br> &lt;/base-config&gt;<br> &lt;/network-security-config&gt;</strong></blockquote><h3>3. Add the security configuration in your manifest</h3><blockquote><strong>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br>&lt;manifest ... &gt;<br> &lt;application android:networkSecurityConfig=&quot;@xml/network_security_config&quot;<br> ... &gt;<br> ...<br> &lt;/application&gt;<br>&lt;/manifest&gt;</strong></blockquote><p>Build, run and voila! You should now be able to reach your secure endpoints.</p><p>More resource and details on the links below.</p><p><a href="https://developer.android.com/training/articles/security-config.html"><em>https://developer.android.com/training/articles/security-config.html</em></a></p><p><a href="https://android-developers.googleblog.com/2016/07/changes-to-trusted-certificate.html"><em>https://android-developers.googleblog.com/2016/07/changes-to-trusted-certificate.html</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d59593a3b6f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>