Solved

Can't get bash command to run for ssl cert signing?

Posted on 2011-03-09
1
478 Views
Last Modified: 2012-05-11
Hi,

I'm trying to use a self-signed cert with android. There's an article here:

  http://blog.crazybob.org/2010/02/android-trusting-ssl-certificates.html#comment-form

that explains how to do it, but I'm not sure how to run the first step:

"1. Grab the public certificate from the server you want to trust. Replace ${MY_SERVER} with your server's address."

echo | openssl s_client -connect ${MY_SERVER}:443 2>&1 | \
 sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > mycert.pem


I've got my server running at https:localhost:8443, so I try using that as the address like:

echo | openssl s_client -connect https://localhost:8443 2>&1 | \
 sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > mycert.pem


but this just prints out an empty mycert.pem file. I'm not sure if the sytax I used above is incorrect, or there is something else wrong in my environment. My server is jetty, and I know it's serving up https on 8443. I'm running on mac.

Thanks
0
Comment
Question by:DJ_AM_Juicebox
1 Comment
 

Accepted Solution

by:
DJ_AM_Juicebox earned 0 total points
ID: 35091787
Oh, if I drop the https from the address, it generates:

echo | openssl s_client -connect localhost:8443 2>&1 | \
>  sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > mycert.pem
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Utilizing an array to gracefully append to a list of EmailAddresses
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now