Sto usando WinHTTP su un progetto Delphi per effettuare chiamate al server.
Script:
userAgent := 'TestClient.exe';
  hsession := WinHttpOpen(pwidechar(userAgent), WINHTTP_ACCESS_TYPE_DEFAULT_PROXY, nil, nil, 0);
  if(hsession = nil) then ShowMessage('Failed WinhttpOpen');
  p := 'https';
  port := 443;
  requestflags := WINHTTP_FLAG_SECURE;
  server := '10.0.0.221';
  hconnection := WinHttpConnect(hsession, PWideChar(server), port, 0);
  if(hconnection = nil) then
  begin
    le := GetLastError;
    ShowMessage('Failed to connect: ' + IntToStr(le));
  end;
  Action := 'GET';
  hInetRequest := WinHttpOpenRequest(hconnection, pwidechar(Action), nil, nil, nil, nil, WINHTTP_FLAG_SECURE);
  if(hInetRequest = nil) then
  begin
    le := GetLastError;
    ShowMessage('Failed to connect: ' + IntToStr(le));
  end;
  WinResult:=WinHttpSendRequest(hInetRequest, nil,0, 0, 0,0,0);
  if(not WinResult) then
  begin
    le := GetLastError;
    WinHttpCloseHandle(hInetRequest);
    ShowMessage('No result obtained : ' + IntToStr(le));
  end;
Domanda; Per la conformità alla sicurezza (FIA_X509_EXT1.1) , la connessione dovrebbe terminare subito dopo l'handshake SSL? Nel caso in cui il peer certificate sia ritenuto non valido. O va bene terminare in seguito?
Effettivo: Quello che sta accadendo è che il client (usando WinHTTP) effettua una chiamata e conferma con successo l'handshake TLS, anche quando il certificato non è valido. Tuttavia, subito dopo la stretta di mano e prima di completare la richiesta, termina la connessione generando un '12175' errore. Qual è l'errore per i certificati non validi? Quale è giusto?
Problema: Per quanto sopra (FIA_X509_EXT1.1) conformità per passare come strumento di verifica, WinHTTP non deve consentire l'handshake riuscito, e quindi terminare la connessione in precedenza.
 Schermata di Wireshark allegata di seguito: (10.0.0.221 è il server)
 
Hogiàfattoquestadomandain