![]() |
PUT/GET mit Client-Zertifikat in PEM-/PKSC12-Container mit Passwort
Ich möchte mit Delphi-Mitteln PUT-, GET- und REST-Aufrufe ausführen. SSL Zugrif mit einem gegebenen Client-Zertifikat in einem PEM-Container mit pwd.
Habe dieses Beispiel gefunden:
Code:
Wie kann ich hier das Container-Passwort angeben?
function TForm1.testCert: boolean;
var IdHTTP1 : TIdHTTP; Id_HandlerSocket : TIdSSLIOHandlerSocketOpenSSL; cert:string; s : string; begin try memo1.Clear; 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'; Id_HandlerSocket := TIdSSLIOHandlerSocketOpenSSL.Create( IdHTTP1 ); cert := 'zugang.pem'; Id_HandlerSocket.SSLOptions.CertFile := cert; (* PEM contain both CERT and Key *) Id_HandlerSocket.SSLOptions.KeyFile := cert; Id_HandlerSocket.SSLOptions.Mode := sslmClient; Id_HandlerSocket.SSLOptions.Method := sslvSSLv23; IdHTTP1.IOHandler := Id_HandlerSocket; memo1.Lines.Add( Id_HandlerSocket.SSLOptions.CertFile ); s := IdHTTP1.Get( 'https://www.scriptjunkie.us/auth/verifycert' ); memo1.lines.Add( s ); Result:=True; finally Id_HandlerSocket.Free; IdHTTP1.Free; end; end; Oder sollte man besser andere Delphi-Komponenten werwenden? Kennt jemand andere/bessere Beispiele? Mit externem OpenSSL und curl klapp das, aber mit welchen Delphi-Tools? LG Hans |
AW: PUT/GET mit Client-Zertifikat in PEM-/PKSC12-Container mit Passwort
Zitat:
|
AW: PUT/GET mit Client-Zertifikat in PEM-/PKSC12-Container mit Passwort
Delphi 10 Berlin!
|
AW: PUT/GET mit Client-Zertifikat in PEM-/PKSC12-Container mit Passwort
...also nichts für ungut, aber die Try...Finally Blöcke solltest du nochmal überdenken!
|
AW: PUT/GET mit Client-Zertifikat in PEM-/PKSC12-Container mit Passwort
Ok - das ist ein Beispiel aus dem Netz.
Wenn nicht so dann: Wie kann ich in Delphi einen PKCS#12-container mit Passwort entpacken? |
AW: PUT/GET mit Client-Zertifikat in PEM-/PKSC12-Container mit Passwort
Gelöst: :-D
In dem Ereignis "IdSSLIOHandlerSocketOpenSSL1.OnGetPassword" kann man z.B. das Passwort beim User abfragen und dem Objekt zurück geben. Viele Dank für Eure Mühen. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 05:19 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz