Secure Search Fails

Oct 29, 2012 at 3:26 PM
Edited Nov 13, 2012 at 9:34 PM

I am attempting to conduct a secure search.  I have set the access field to ALL and created network credentials to give to ca.credentials.  The GSA is set to do secure searches over an https connection. I keep getting "System.IO.IOException: The handshake failed due to an unexpected packet format." error returned from the GSA. Any ideas what I am doing wrong?

UPDATE:  I changed to port number in the initialization of the clientaccess object from 80 to 443 to match the https connection.  I am now getting a 417 expectation failed error.

Here is my code:


public static GSALib.GSA.Response GetGoogleSearchResponse(string searchTerm, int start, int numToGet)
        GSALib.GSA.Query q = new GSALib.GSA.Query();

        q.setSiteCollections(new string[] { ConfigurationManager.AppSettings["GSACollection"] });







        GSALib.GSA.QueryTerm term = new GSALib.GSA.QueryTerm(searchTerm);


//Changed port number to 443. GSALib.GSA.ClientAccess ca = new GSALib.GSA.ClientAccess("https", "addressOfGoogleServer", "443", "search"); ca.credentails = System.Net.CredentialCache.DefaultNetworkCredentials; try { GSALib.GSA.Response response = ca.getGSAResponse(q, null); return response; } catch (GSALib.Exceptions.GSANeedNetworkCredentailsException ex) { EventLogWriter.WriteExceptionToEventLog("GSA Secure call made without credentials.", ex.ToString()); return null; } catch (System.Exception ex) { EventLogWriter.WriteExceptionToEventLog("Error occured in GetGoogleSearchResponse.", ex.ToString()); return null; } }
Nov 13, 2012 at 4:54 AM

Is SSL setup correct on your GSA?  How is universal login configured?

Nov 13, 2012 at 9:39 PM
Edited Mar 3, 2014 at 3:30 PM
I updated the post to reflect the "updates" I have put in place since I first posted.  I am now receiving "417 Expectation Failed"
SSL is set up correctly.  I can visit the GSA's interface and perform secure searches with no problem.  Universal login is configured to use Kerberos and NTLM. 
Mar 1, 2014 at 3:28 PM
Can you please specify what the fix was for the "417 Expectation failed" error.Facing the the same issue after setting the access parameter as "a".Also sending the default network credentials.What else need to be set in the C# code?
Mar 1, 2014 at 8:14 PM
Mar 3, 2014 at 6:23 AM
Thanks for the quick reply. I had gone through the link previously. One thing I forgot to mention is that the secure search is working perfectly through the google interface.The secure search doesn't work only when I hit the GSA from my .NET code. If the problem was with the SSL setup, it shouldn't have worked from the google interface either. Please correct me if I am wrong.

Some more info:

When I check the serving logs after hitting the GSA from the .Net app,the authentication ends abruptly after redirecting to SAML.
The query has reached GSA,but looks like it needs some additional info to continue with the authentication.

Logfile for request: 8254393637994017885
140361 22:06:03.446
[Appliance Frontend]
Query received: walking yoga
140361 22:06:03.449

[Appliance Frontend] Full query URI: /search?q=walking+yoga&access=a&as_occt=&num=10&start=0&as_sitesearch=&filter=1&ie=utf8&oe=utf8&lr=&getfields=vc&UserQuery=walking+yoga&userInfo=ashaale1&site=A000_iSearch%7cP002_AllVC%7cP002_emb&client=A000_iSearch&output=xml_no_dtd
140361 22:06:03.465

[Authentication] New session for this request: d17ee287c519814c2e48d4ae46d293af
140361 22:06:03.474

running AuthN mechanism SAML
140361 22:06:03.478 [Authentication] Redirecting user to be authenticated by the Security Manager:
Mar 3, 2014 at 1:49 PM
How is your universal Login Manager setup? .NET will support Kerberos and NTLM.
Mar 3, 2014 at 3:28 PM
ashaalex30 wrote:
Can you please specify what the fix was for the "417 Expectation failed" error.Facing the the same issue after setting the access parameter as "a".Also sending the default network credentials.What else need to be set in the C# code?
ashaalex30, I have yet to fix the "417 Expectation Failed" error. The "fix" I applied is described in the original post as an update. I was originally getting a After changing the port number from 80 to 443, I started receiving "417...". If you find a solution to your problem please be sure to post it here as I am stuck in a situation very similar to yours.
Mar 3, 2014 at 3:32 PM
Also, if you feel there is an issue, please create one and we'll look into it.
Mar 4, 2014 at 7:23 AM
I have created an issue for the same (item# 16740).Can you please provide me with a working .Net(C#) implementation of the same?