Archived Forum Post

Index of archived forum posts

Question:

Unexpected ServerKeyExchange message.

Jan 08 '15 at 10:48

Hello.

I am evaluating chilkat http because i got to use firebase api

whenever trying to connect to firebase with this code

throws Unexpected ServerKeyExchange message.

procedure TForm1.Button11Click(Sender: TObject); var req: TChilkatHttpRequest; http: TChilkatHttp; success: Integer; jsonText: WideString; responseBody: WideString;

begin req := TChilkatHttpRequest.Create(Self); http := TChilkatHttp.Create(Self);

// Any string unlocks the component for the 1st 30 days. success := http.UnlockComponent('Anything for 30-day trial'); if (success <> 1) then begin Memo1.Lines.Add(http.LastErrorText); Exit; end;

// The PUT request to be sent will look like this: //

{"user":"doctoravatar@penzance.com","forecast":7,"t":"vlIj","zip":94089}

// First, remove default header fields that would be automatically // sent. (These headers are harmless, and shouldn't need to // be suppressed, but just in case...) http.AcceptCharset := ''; http.UserAgent := ''; http.AcceptLanguage := '';

// Suppress the Accept-Encoding header by disallowing // a gzip response: http.AllowGzip := 0;

// If a Cookie needs to be added, it may be added by calling // AddQuickHeader:

// Modify the default "Accept" header: http.Accept := 'application/json';

jsonText := '{"user":"doctoravatar@penzance.com","forecast":7,"t":"vlIj","zip":94089}';

// To use SSL/TLS, simply use "https://" in the URL.

// IMPORTANT: Make sure to change the URL, JSON text, // and other data items to your own values. The URL used // in this example will not actually work.

responseBody := http.PutText('https://dazzling-inferno-1655.firebaseio.com/.json',jsonText,'utf-8','application/jsonrequest',0,0); if (Length(responseBody) = 0 ) then begin Memo1.Lines.Add(http.LastErrorText); end else begin // Display the JSON response. Memo1.Lines.Add(responseBody);

end;

end;


Answer

Assuming you are using the ActiveX w/ Delphi, it is likely the problem is fixed with this latest pre-release:

32-bit Download: http://www.chilkatsoft.com/download/preRelease/ChilkatAx-9.5.0-win32.zip
64-bit Download: http://www.chilkatsoft.com/download/preRelease/ChilkatAx-9.5.0-x64.zip