Bonjour à tous,
Sous D7, j'utilise le composant SSLHttpCli (et SSlContext associé) de chez ICS pour récupérer une info sur un WebService.
Tout fonctionne très bien lorsque mon logiciel ne tourne pas sous certains Win10Pro.
J'ai un Win10Pro chez moi et cela fonctionne très bien.
Y-a-t-il quelque chose à savoir sur Win10Pro, sur le protocol TLS1.2, Delphi 7 qui ferait que cela ne fonctionne pas ?
J'ai essayé de virer l'antivirus mais rien n'y fait.
Auriez vous une idée ? J'ai demandé plus d'information car pour l'instant je n'ai même pas une info sur une erreur éventuelle.
Ajout: J'ai une erreur "Connection aborted on request"
Voici mon bout de code:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50 function TOPSKey.GetOPSToken : String; var Data : AnsiString; RcvStrm : TMemoryStream; SndStrm : TMemoryStream; c : PChar; Cle : String; F : TFileStream; begin Result := ''; SndStrm := TMemoryStream.Create; RcvStrm := TMemoryStream.Create; Data := 'grant_type=client_credentials'; SSL2.Proxy := Trim(Main.ProxyHostName); SSL2.ProxyPort := Trim(Main.ProxyPort); SSL2.ProxyUsername := Trim(Main.ProxyUserName); SSL2.ProxyPassword := Trim(Main.ProxyPassword); SSL2.SendStream := SndStrm; SSL2.SendStream.Write(Data[1], Length(Data)); SSL2.SendStream.Seek(0,0); SSL2.RcvdStream := RcvStrm; SSL2.URL := 'https://xxxxxxx/accesstoken'; try SSL2.Post; finally RcvStrm.Seek(0, 0); SetLength(Data, RcvStrm.Size); RcvStrm.Read(Data[1], Length(Data)); c := PChar(Data); If Scan('"access_token": "', '",', c, Cle) then result := Cle; // Ce bout de code vient d'être ajouté pour avoir plus d'info du client et eventuellement si il y a une erreur F:=TFileStream.Create(Main.WorkingPath+'token.log', fmCreate); Try WriteLn(F, 'Token Information'); WriteLn(F, Data); Finally F.Free; End; RcvStrm.Free; SndStrm.Free; end; end;
Partager