I'm trying to get https page with client side SSL certificate, with Indy TIdHTTP.
Code is
var IdHTTP1 : TIdHTTP;
IdSSLIOHandlerSocket : TIdSSLIOHandlerSocketOpenSSL;
begin
try
IdHTTP1 := TIdHTTP.Create( self );
IdHTTP1.Request.BasicAuthentication := False;
IdHTTP1.Request.UserAgent := 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0';
IdSSLIOHandlerSocket := TIdSSLIOHandlerSocketOpenSSL.Create( IdHTTP1 );
IdSSLIOHandlerSocket.SSLOptions.CertFile := 'cert.pem';
IdSSLIOHandlerSocket.SSLOptions.Method := sslvTLSv1_2;
IdSSLIOHandlerSocket.SSLOptions.Mode:= sslmUnassigned;
IdHTTP1.IOHandler := IdSSLIOHandlerSocket;
writeln( IdHTTP1.Get( 'https://www.scriptjunkie.us/auth/verifycert' ) );
finally
IdSSLIOHandlerSocket.Free;
IdHTTP1.Free;
end;
Get
is not authenticating. Client PEM certificate is not accepted.
How to get url with client cert?
I've use https://www.scriptjunkie.us/auth/verifycert
site with free client side SSL certificated. FPC is 3.0.2, Indy is 10.6.2.0
Get
raising an exception? If so, what does it say? Why are you using a client certificate in the first place? Does the server only respond to authenticated clients? Are you able to access the server with a standard web browser?Get
is not raising an error then neither HTTP nor SSL are failing. What makes you think this is an SSL issue, and not simply a user authentication issue? Does the server require a client to login, either through HTTP authentication or HTML webform authentication?No valid cert
. Can you test it?