• R/O
  • SSH
  • HTTPS

mantisbtmonitor: Commit


Commit MetaInfo

Revision42 (tree)
Time2019-07-10 06:43:10
Authorderekwildstar

Log Message

- Ajustes para ignorar problemas com certificados do TJPE

Change Summary

Incremental Difference

--- trunk/client/src/lib/mnws.pas (revision 41)
+++ trunk/client/src/lib/mnws.pas (revision 42)
@@ -54,10 +54,34 @@
5454
5555 implementation
5656
57+uses
58+ SOAPHTTPTrans, WinInet;
59+
60+// quando o certificado do tj está fodido, a url do serviço precisa ser https e
61+// é preciso ignorar autoridade certificadora. Para isso, é preciso usar o
62+// evento THTTPReqResp.OnBeforePost
63+type
64+ THTTPReqRespEvents = class
65+ public
66+ class procedure DoBeforePost(const AHTTPReqResp: THTTPReqResp; AData: Pointer);
67+ end;
68+
69+class procedure THTTPReqRespEvents.DoBeforePost(const AHTTPReqResp: THTTPReqResp; AData: Pointer);
70+var
71+ FlagsLen: DWORD;
72+ Flags: DWORD;
73+begin
74+ FlagsLen := SizeOf(DWORD);
75+ InternetQueryOption(AData, INTERNET_OPTION_SECURITY_FLAGS, @Flags, FlagsLen);
76+
77+ Flags := Flags or SECURITY_FLAG_IGNORE_UNKNOWN_CA or SECURITY_FLAG_IGNORE_REVOCATION;
78+ InternetSetOption(AData, INTERNET_OPTION_SECURITY_FLAGS, @Flags, FlagsLen);
79+end;
80+
5781 function GetmnwsPortType(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): mnwsPortType;
5882 const
59- defWSDL = 'http://192.168.251.88/mnws/index.php?wsdl';
60- defURL = 'http://sdwebtjpetemp.tjpe.gov.br/mnws/index.php';
83+ defWSDL = 'https://desenvolvimento.tjpe.gov.br/mnws/index.php?wsdl';
84+ defURL = 'https://desenvolvimento.tjpe.gov.br/mnws/index.php';
6185 defSvc = 'mnws';
6286 defPrt = 'mnwsPort';
6387 var
@@ -72,9 +96,13 @@
7296 Addr := defURL;
7397 end;
7498 if HTTPRIO = nil then
75- RIO := THTTPRIO.Create(nil)
99+ begin
100+ RIO := THTTPRIO.Create(nil);
101+ RIO.HTTPWebNode.OnBeforePost := THTTPReqRespEvents.DoBeforePost;
102+ end
76103 else
77104 RIO := HTTPRIO;
105+
78106 try
79107 Result := (RIO as mnwsPortType);
80108 if UseWSDL then
@@ -92,7 +120,7 @@
92120
93121
94122 initialization
95- InvRegistry.RegisterInterface(TypeInfo(mnwsPortType), 'http://sdwebtjpetemp.tjpe.gov.br/soap/mnws', 'UTF-8');
96- InvRegistry.RegisterDefaultSOAPAction(TypeInfo(mnwsPortType), 'http://sdwebtjpetemp.tjpe.gov.br/mnws/index.php/%operationName%');
123+ InvRegistry.RegisterInterface(TypeInfo(mnwsPortType), 'https://desenvolvimento.tjpe.gov.br/mnws/', 'UTF-8');
124+ InvRegistry.RegisterDefaultSOAPAction(TypeInfo(mnwsPortType), 'https://desenvolvimento.tjpe.gov.br/mnws/index.php/%operationName%');
97125
98126 end.
\ No newline at end of file
Show on old repository browser