snipt

Ctrl+h for KB shortcuts

Text only

Android/Cordova: http requests not working on jarsigned app

1
2
3
4
5
Only works on debug.
http works, https doesn't.

The problem could come from the certificate:
http://stackoverflow.com/questions/20036260/phonegap-android-app-ajax-requests-to-https-fail-with-status-0
https://snipt.net/embed/b57a79b32ec8fc0a20de53764adc8a19/
/raw/b57a79b32ec8fc0a20de53764adc8a19/
b57a79b32ec8fc0a20de53764adc8a19
text
Text only
5
2017-01-01T06:31:45
True
False
True
Jul 29, 2014 at 11:45 AM
/api/public/snipt/135973/
androidcordova-http-requests-not-working-on-jarsigned-app-50e8fd6a
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>Only works on debug. </span><span id="L-2"><a name="L-2"></a>http works, https doesn&#39;t. </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a>The problem could come from the certificate: </span><span id="L-5"><a name="L-5"></a>http://stackoverflow.com/questions/20036260/phonegap-android-app-ajax-requests-to-https-fail-with-status-0 </span></pre></div> </td></tr></table>
android, certificate, http

Bash

svn update with no interaction and accept certificate from cli

svn up --username <user> --password <psw> --non-interactive --trust-server-cert
https://snipt.net/embed/8ee9a30e7f44092e596ab7820a8c1502/
/raw/8ee9a30e7f44092e596ab7820a8c1502/
8ee9a30e7f44092e596ab7820a8c1502
bash
Bash
1
2019-06-24T13:17:58
True
False
False
Jul 19, 2013 at 09:24 AM
/api/public/snipt/68603/
svn-update-with-no-interaction-and-accept-certificate-from-cli
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>svn up --username &lt;user&gt; --password &lt;psw&gt; --non-interactive --trust-server-cert </span></pre></div> </td></tr></table>
accept, certificate, cli, command, line, linux, shell, svn, up, update

Bash

Show and export user certificates from Mozilla Firefox

1
2
3
certutil -K -d <PROFILE_DIRECTORY>
modutil -list -dbdir <PROFILE_DIRECTORY>
modutil -rawlist -dbdir <PROFILE_DIRECTORY>
https://snipt.net/embed/9b75f62969c854fdb6333bb01480454a/
/raw/9b75f62969c854fdb6333bb01480454a/
9b75f62969c854fdb6333bb01480454a
bash
Bash
3
2019-06-22T06:13:59
True
False
False
Apr 09, 2013 at 06:17 AM
/api/public/snipt/58999/
show-and-export-user-certificates-from-mozilla-firefox
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>certutil -K -d &lt;PROFILE_DIRECTORY&gt; </span><span id="L-2"><a name="L-2"></a>modutil -list -dbdir &lt;PROFILE_DIRECTORY&gt; </span><span id="L-3"><a name="L-3"></a>modutil -rawlist -dbdir &lt;PROFILE_DIRECTORY&gt; </span></pre></div> </td></tr></table>
certificate, certificates, certutil, firefox, modutil, mozilla

Bash

Generate certificate

openssl req -new -x509 -days 1826 -nodes -out server.crt -keyout server.key
https://snipt.net/embed/fbe9d3e167fe7af286460844df72dd59/
/raw/fbe9d3e167fe7af286460844df72dd59/
fbe9d3e167fe7af286460844df72dd59
bash
Bash
1
2019-06-24T18:30:51
True
False
True
Oct 21, 2012 at 11:44 AM
/api/public/snipt/48849/
generate-certificate
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>openssl req -new -x509 -days <span class="m">1826</span> -nodes -out server.crt -keyout server.key </span></pre></div> </td></tr></table>
bash, certificate

Bash

How to check an SSL connection and server certificate.

$ openssl s_client -host www.google.com -port 443
https://snipt.net/embed/8ca067dd09635938a11b14aac258b867/
/raw/8ca067dd09635938a11b14aac258b867/
8ca067dd09635938a11b14aac258b867
bash
Bash
1
2019-06-22T20:02:09
True
False
False
/api/public/snipt/29640/
how-to-check-an-ssl-connection-and-server-certificate
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>$ openssl s_client -host www.google.com -port 443 </span></pre></div> </td></tr></table>
certificate, openssl, ssl

Bash

create pkcs12 cert envelope with openssl

1
2
3
4
# mycert.crt - certificate file
# mykey.key - private key file

openssl pkcs12 -export -in mycert.crt -inkey mykey.key -out env.p12 -password stdin
https://snipt.net/embed/6b39879011e9b829a6c3d6644cd6d6ae/
/raw/6b39879011e9b829a6c3d6644cd6d6ae/
6b39879011e9b829a6c3d6644cd6d6ae
bash
Bash
4
2019-06-23T19:36:21
True
False
False
/api/public/snipt/11486/
create-pkcs12-cert-envelope-with-openssl
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1"># mycert.crt - certificate file</span> </span><span id="L-2"><a name="L-2"></a><span class="c1"># mykey.key - private key file</span> </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a>openssl pkcs12 -export -in mycert.crt -inkey mykey.key -out env.p12 -password stdin </span></pre></div> </td></tr></table>
"public key", bash, certificate, openssl, p12, pkcs12, pki

Bash

plesk doesnt recognize ssl certificate

cd /etc/httpd/conf.d/; cp ssl.conf ssl.conf.old && sed '/VirtualHost/,$  s/^/#/'  ssl.conf.old > ssl.conf && service httpd restart
https://snipt.net/embed/d47a5e18be232f08173e9112c4b6224c/
/raw/d47a5e18be232f08173e9112c4b6224c/
d47a5e18be232f08173e9112c4b6224c
bash
Bash
1
2019-06-11T21:48:33
True
False
False
/api/public/snipt/5972/
plesk-doesnt-recognize-ssl-certificate
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="nb">cd</span> /etc/httpd/conf.d/<span class="p">;</span> cp ssl.conf ssl.conf.old <span class="o">&amp;&amp;</span> sed <span class="s1">&#39;/VirtualHost/,$ s/^/#/&#39;</span> ssl.conf.old &gt; ssl.conf <span class="o">&amp;&amp;</span> service httpd restart </span></pre></div> </td></tr></table>
certificate, plesk, ssl