Search the Community
Showing results for tags 'https'.
Found 5 results
-
Hello, I'm having trouble trying to upload files to my s3 bucket in my Delphi 7 application. I have a python api that generates a presigned url for putting files, and it works perfectly. I am able to send the files to the s3 bucket through Postman, setting the body as binary and the url as the presigned s3 url. Now for the Delphi part, basically what my code does is get the presigned url and send a PUT to it with the TFileStream of a file selected by the user. var SignedURL , res , filePath : string; httpClient : TIdHTTP; SSLIOHandler : TIdSSLIOHandlerSocketOpenSSL; jsonRes : ISuperObject; fileStream : TFileStream begin filePath := 'path/to/file.pdf'; // file selected by user in OpenDialog SignedURL := 'signedUrlGeneratedByPythonCode'; // response from calling my python web api fileStream := TFileStream.Create(filePath, fmOpenRead or fmShareDenyNone); httpClient := TIdHTTP.Create; httpClient.Request.Accept := 'application/json'; SSLIOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil); SSLIOHandler.SSLOptions.Method := sslvTLSv1_2; httpClient.IOHandler := SSLIOHandler; try res := httpClient.Put(url, fileStream); jsonRes := SO(res); finally fileStream.Free; httpClient.Free; SSLIOHandler.Free; end; end; With this code I get an access violation at the res := httpClient.Put(url, fileStream); if I run just the Put on runtime, without assigning the response to a variable I get a "Delphi exception EIdSocketError at $2646F905". Removing the SSLIOHandler, I get a "Socket Error #10054 Connection reset by peer.". I'm still a beginner in coding (and very new with Delphi), so I can't pinpoint what exactly could be the problem. I assume it's either because of AWS using HTTPS (although the python api also uses HTTPS and I don't need to set a SSLIOHandler to make a request to it) and my SSL/TLS not working properly or I'm passing the file binaries in the wrong format and the AWS server is refusing the connection instantly. Using: Delphi 7, Indy 10 Thanks in advance, any help would be very much appreciated.
-
Delphi 10.2, Indy 10.x Just trying to understand why this works. i have a dll that uses https to connect to our server. Works 99% of all our clients but for some outliers i kept getting 10061 connection refused error. after a bunch of trial and error while working with clients IT dept we finally tried running fiddler to help track down the issue. this tracking had me add proxyparams.proxyserver and proxyport to track in fiddler. well it would work without error. after rollbacks and testing we discovered that by leaving the proxyserver 127.0.0.1 in place that it would work and connect to our server and do whatever was needed. now any time we get the 10061 our support sends over the proxyserver version of the dll. what is the reason or area that we should look at to find the source of the issue to not have to use the workaround proxyserver. we bypassed AV, firewall off and allow access from internet explorer (edge, chrome, firefox,...)
-
I am trying to connect with web-browser to Indy HTTP server runing on https://127.0.0.1:4567. I have read many tutorials and some of them are interesting, like: 1. https://mikejustin.wordpress.com/2019/06/14/how-to-lets-encrypt-certificates-with-indy-http-server/ 2. https://synaptica.info/en/2016/09/21/build-your-own-https-server-with-delphi/ I have created self signed certificates with help of this example tutorial: https://github.com/glenkleidon/DelphiCertAuth As a passphrase for testing I used "123456". After that I have installed newly generated file root_cert.crt in Trusted Root CA in Windows (using "WinKey+R" and certmgr.msc) In my code I have set: ... // create IOHandler for OpenSSL IdServerIOHandlerSSLOpenSSL1.SSLOptions.CertFile := 'mycomputerCertificate.pem'; IdServerIOHandlerSSLOpenSSL1.SSLOptions.KeyFile := 'mycomputerPrivateKey.pem'; IdServerIOHandlerSSLOpenSSL1.SSLOptions.RootCertFile := 'certificateAuthorityCertificate.pem'; IdServerIOHandlerSSLOpenSSL1.SSLOptions.Mode := sslmServer; IdServerIOHandlerSSLOpenSSL1.SSLOptions.SSLVersions := [sslvTLSv1, sslvTLSv1_1, sslvTLSv1_2]; ... procedure TForm1.IdServerIOHandlerSSLOpenSSL1GetPassword(var Password: string); begin Password := '123456'; end; ... procedure TForm1.IdHTTPServer1QuerySSLPort(APort: Word; var VUseSSL: Boolean); // This will not be called when the request is a HTTPS request // It facilitates the use of the server for testing via HTTP://localhost:8080 (i.e. without SSL) begin VUseSSL := (APort <> 8080); end; ... function TForm1.IdServerIOHandlerSSLOpenSSL1VerifyPeer(Certificate: TIdX509; AOk: Boolean; ADepth, AError: Integer): Boolean; begin if ADepth = 0 then Result := AOk else Result := True; end; ... Unfortunately, when I try to connect to https://127.0.0.1:4567 I get an warning (check image). In application I can see messages and exception raised: IdServerIOHandlerSSLOpenSSL1StatusInfo(const AMsg: string); AMsg := SSL status: "before/accept initialization"; AMsg := SSL status: "before/accept initialization"; AMsg := SSL status: "SSLv3 read client hello A"; AMsg := SSL status: "SSLv3 write server hello A"; AMsg := SSL status: "SSLv3 write certificate A"; AMsg := SSL status: "SSLv3 write server done A"; AMsg := SSL status: "SSLv3 flush data"; AMsg := SSL status: "SSLv3 read client certificate A"; AMsg := SSL status: "SSLv3 read client key exchange A"; AMsg := SSL status: "error"; 127.0.0.1:55810 Stat Disconnected. IdHTTPServer1Exception(AContext: TIdContext; AException: Exception); EIdOSSLUnderlyingCryptoError: Error accepting connection with SSL. error:14094416:SSL routines:ssl3_read_bytes:sslv3 alert certificate unknown Am I doing something wrong or I am missing something? Why I can't connect to IP address without warning?
-
Hi everyone I have a PHP file that uploads images to me. I should send with HTTPS and post the parameters from Delphi like this. <form action = "UPLOAD.PHP" enctype = "multipart / form-data"> <input type = "file" name = "upfile" required /> <input type = "submit" value = "Upload" /> </form> Unfortunately I'm not very good, I was able to make calls in https and post, but I could not set up idHTTP correctly Has anyone already encountered this problem? Thanks to all.
-
[BUG] HTTPS support in 64bits - Access Violation
Marcelo Jaloto posted a topic in ICS - Internet Component Suite
Can someone help me? We are having a bug (access violation) with SSL (HTTPS support) only in 64bits. My current Overbyte ICS version is 8.63. The bug is attached image. {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} { V8.57 convert wire-format concactanted length prefixed strings to TStrings } function IcsWireFmtToStrList(Buffer: TBytes; Len: Integer; SList: TStrings): Integer; var offset, mylen: integer; AStr: AnsiString; begin Result := 0; if NOT Assigned(SList) then Exit; SList.Clear; offset := 0; while offset < Len do begin mylen := Buffer[offset]; if mylen = 0 then Exit; // illegal offset := offset + 1; SetLength(AStr, mylen); Move(Buffer[offset], AStr[1], mylen); SList.Add(String(AStr)); offset := offset + mylen; end; Result := Slist.Count; end;