?
Solved

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

Posted on 2011-03-09
1
Medium Priority
?
496 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to use a free utility called 'Parkdale' to easily test the performance and benchmark any Hard Drive(s) installed in your computer. We also look at RAM Disks and their speed comparisons.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Starting up a Project

764 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