Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7832065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T12:01:15+00:00 2026-06-02T12:01:15+00:00

I am porting an application which internally makes cURL calls to connect to a

  • 0

I am porting an application which internally makes cURL calls to connect to a server securely. It uses downloaded certificate and private key file before making request to the server.

I have a “My_Private_key.pem” file containing RSA Private key, a “My_Certificate.pem” file containing the certificate server sent and a password with which “My_Private_key.pem” is encrypted. Now cURL has an option for setting SSLKey,SSLCertificate and Password.
Example

curl_easy_setopt(curl, CURLOPT_SSLCERT, credentials->certfile);
curl_easy_setopt(curl, CURLOPT_SSLKEY, credentials->keyfile);
curl_easy_setopt(curl, CURLOPT_KEYPASSWD, credentials->passwd);

Then cURL uses this information to request the server. I want to do a similar thing in Android. I have gone through many links which help me creating my own HttpClient which uses EasySSLSocketFactory,EasyX509TrustManager but i could not find a way to set these options in Android.

What is the equivalent way to do in Android ?

I am very new to SSL and so my question can be a little naive so please bear with it 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T12:01:24+00:00Added an answer on June 2, 2026 at 12:01 pm

    You have to create a PKCS#12 file from your key and certificate, load it as a keystore and initialize HttpClient (or HttpsURLConnection) with it. For HttpClient you can use the SSLSocketFactory class to initialize the client with your key and certificate.

    You can use something like this to create the PKCS#12 file:

    $ openssl pkcs12 -export -in mycert.pem -inkey mykey.key -out mystore.pfx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

we are in the process of porting a 32bit application, which uses the Outlook
I'm porting a UNIX application which uses the Qt framework (Qt, not QuickTime) to
I'm porting an application which uses icons that are not all the same size.
I am porting an application which runs as a background service in windows at
In a wxPython application, which i am porting to Mac OSX, I set title
I am working on my first Grails application, which involves porting over an old
I'm porting a C# application which is completely written in windows under Visual studio
I am porting a linux application onto android, which runs on beagle board. My
I am porting a Excel-VBA based app which uses Userforms over to a C#
I'm interested in porting an existing application which was written using Spring/Struts2/Hibernate to GAE.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.