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

  • SEARCH
  • Home
  • 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 7899827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:48:34+00:00 2026-06-03T08:48:34+00:00

I need to connect to remote server via FTPS (implicit or explicit). I successfully

  • 0

I need to connect to remote server via FTPS (implicit or explicit). I successfully connected to server via FileZilla. Also I tested code to retrieve file from public ftp: http://ftp.mozilla.org
Now I need the same code for ftps. I have problem with private key and KeyStore

String keyPath = "src/test/resources/keys/thekey.ppk";
        FTPSClient client = new FTPSClient();
        FileOutputStream fos = null;
        try {

            KeyStore ks = KeyStore.getInstance("JKS"); //
            FileInputStream fis = new FileInputStream(keyPath);
            ks.load(fis, "".toCharArray());//java.io.IOException: Invalid keystore format
            fis.close();
            KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory
                    .getDefaultAlgorithm());
            kmf.init(ks, "".toCharArray());

            System.out.println("connecting to 1.1.1.1...");
            client.setDefaultTimeout(10000);
            client.connect("1.1.1.1", 2190);
            System.out.println("loggin in...");
            System.out.println("login: " + client.login("login", "pass"));
            String remoteDir = "/pub/downloaded/";
            String remoteFileName = "testMsg.txt";
            String localFileName = "testMsg.local.txt";

            fos = new FileOutputStream(localFileName);

            System.out.println("retrieving file...");
            boolean isRetrieved = client.retrieveFile(remoteDir + remoteFileName, fos);
            System.out.print("File: " + remoteDir + remoteFileName + "; IsRetrieved: " + isRetrieved + "\n");

        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                if (fos != null) {
                    fos.close();
                }
                client.disconnect();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

Keys were generated in PuTTY format. What else options can I put here KeyStore.getInstance(“JKS”).
If ommit the part with KeyStore than code reach line with client.retrieveFile and suspends for a long time.
Need help to import keys, plz.

  • 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-03T08:48:36+00:00Added an answer on June 3, 2026 at 8:48 am

    FTPS stands for FTP-over-SSL. SSL uses X.509 certificates for authentication (we omit other rarely used methods now). Putty is SSH/SFTP client (where SFTP stands for SSH File Transfer Protocol) and putty keys are SSH keys. Consequently you can’t use SSH keys for SSL authentication.

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

Sidebar

Related Questions

So I need to connect to a mssql server via Windows Authentication from a
I need to connect to a remote server (listening on port 9442) in my
What ports do you need to open in a firewall to connect a remote
How do I connect to a remote Oracle database instance from PHP? I need
Within c#, I need to be able to Connect to a remote system, specifying
I need connect to server git. http://help.github.com/win-set-up-git/ I do everything to the point, 4
I need to connect my php script to Gmail Atom feed to retrieve the
i need to connect to another server we manage and have it's results (in
I need to do a mysqldump of a database on a remote server, but
My client application uses a boost::asio::ip::tcp::socket to connect to a remote server. If the

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.