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 6742093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:48:08+00:00 2026-05-26T11:48:08+00:00

I have been trying to get an Authentication Key for managing a Google Search

  • 0

I have been trying to get an Authentication Key for managing a Google Search Appliance and modify its Access Control Lists (ACLs).

This is my code:

    SocketAddress proxyAddress = new InetSocketAddress(PROXY_HOST,PROXY_PORT);
    Proxy proxy = new Proxy(Proxy.Type.HTTP, proxyAddress);
    URL clientLoginUrl = new URL("https://my.server.com:8443/accounts/ClientLogin");
    HttpURLConnection clientLoginSecureConnection = 
        (HttpURLConnection)clientLoginUrl.openConnection(proxy);
    clientLoginSecureConnection.setDoInput(true);
    clientLoginSecureConnection.setDoOutput(true);
    clientLoginSecureConnection.setUseCaches(false);
    clientLoginSecureConnection.setRequestProperty("Content-Type",          
        "application/x-www-form-urlencoded");
    StringBuilder content = new StringBuilder();
    content.append("Email=").append(
    URLEncoder.encode(Constants.GSA_AUTH_USER, "UTF-8"));
    content.append("&Passwd=").append(
    URLEncoder.encode(Constants.GSA_AUTH_PASSWORD, "UTF-8"));
    OutputStream outputStream = clientLoginSecureConnection.getOutputStream();
    outputStream.write(content.toString().getBytes("UTF-8"));
    outputStream.close();
    // Retrieve the output
    int responseCode = clientLoginSecureConnection.getResponseCode();
    System.out.println("Response code: " + responseCode);
    InputStream inputStream;
    if (responseCode == HttpURLConnection.HTTP_OK) {
        inputStream = clientLoginSecureConnection.getInputStream();
    } else {
        inputStream = clientLoginSecureConnection.getErrorStream();
    }
    String postOutput = toString(inputStream);
    StringTokenizer tokenizer = new StringTokenizer(postOutput, "=\n ");
    String key = null;
    while (tokenizer.hasMoreElements()) {
        if (tokenizer.nextToken().equalsIgnoreCase("Auth")) {
            if (tokenizer.hasMoreElements()) {
                key = tokenizer.nextToken();
            }
            break;
        }
    }
    if (key == null) {
    System.out.println("Error response from server:\n" + postOutput);
    } else {
        System.out.println("Key found: " + key);
}

I have followed the instructions here but I always get this exception:

javax.net.ssl.SSLHandshakeException: Remote host closed connection
during handshake at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:808)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1120)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1147)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1131)
at
sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:434)
at
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:166)
at
sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:904)
at
sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:230)
at
com.mycompany.gslisting.GetKeysTestCase.testGetAccessControlListKeys(GetKeysTestCase.java:90)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597) at
junit.framework.TestCase.runTest(TestCase.java:168) at
junit.framework.TestCase.runBare(TestCase.java:134) at
junit.framework.TestResult$1.protect(TestResult.java:110) at
junit.framework.TestResult.runProtected(TestResult.java:128) at
junit.framework.TestResult.run(TestResult.java:113) at
junit.framework.TestCase.run(TestCase.java:124) at
junit.framework.TestSuite.runTest(TestSuite.java:243) at
junit.framework.TestSuite.run(TestSuite.java:238) at
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.io.EOFException: SSL peer shut down incorrectly at
com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:333)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:789)
… 27 more

Any ideas?

  • 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-05-26T11:48:08+00:00Added an answer on May 26, 2026 at 11:48 am

    Found it!

    I just followed the instructions in this site.
    What I did was downloading the site certificate (.cer) using a browser (Chrome) and import it to the default keystore by running:

    #keytool -import -alias GSAAPI -file ./GSA.cer
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to get this to work. Basically I have a search
I have been trying to get around this error for a day now and
I have been trying to get more in to TDD. Currently keeping it simple
I have been trying to get yui-css grid system to make a three column
I have been trying to get nServiceBus to work with Ninject 2.0 as the
I have been trying to get LastBootUpTime using Win32_OperatingSystem class (WMI). HRESULT hr =
I have been trying to get this one section of my UI to immediatly
I have been trying all afternoon to get the jQuery Sifr Plugin ( http://jquery.thewikies.com/sifr/
I have been trying for a long time to get SQL Server Express on
I have been trying to days now to get this website completed ... however,

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.