Re: [twsocket] Receive contents of remote text file over SSL
On 12/4/2011 8:36 μμ, Arno Garrels wrote: Dimitris Botsis wrote: Hi again, what I try now is get the non-SSL OverByteIcsHttpDemo, and instead "Go" button calling httpcli component, it calls an sslhttpcli component (I also added a proper sslcontext component) so code became : procedure THttpToMemoForm.GoButtonClick(Sender: TObject); var Data : TMemoryStream; begin DisplayMemo.Clear; GoButton.Enabled := FALSE; Data := TMemoryStream.Create; try sslhttpcli1.URL:= URLEdit.Text; //httpcli1.Proxy := ProxyEdit.Text; //httpcli1.ProxyPort := '80'; sslhttpcli1.RcvdStream := Data; sslhttpcli1.Get; LoadMemoFromMemoryStream(DisplayMemo, Data); finally Data.Free; GoButton.Enabled := TRUE; end; end; As URLEdit1.Text, I set the whole URL up to the file, so it's like : https://www.mydomain.com/myfile.txt Can someone please explain or find why this does not work ? Show us your code in LoadMemoFromMemoryStream. It makes no difference whether you use a TFile or TMemorystream. Maybe you simply forgot to rewind the stream before the memo loads it? No, LoadMemoryFromMemoryStream is completely untouched and stream is being rewind. Code is exactly the same. Now I set to sslhttcli component that I added, "SocksLevel" to 5 (was 0) and seems to get better but generally it seems rather unstable. Additionally I have another problem since I want to load all the contents to a RichEdit but very often I get "Richedit Line insertion error" but while I used Thttpget (but without SSL support) for some months it worked without any problem. I suppose I must search more to find solution using ICS - any help/instructions is appreciated. Thank you. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Receive contents of remote text file over SSL
Dimitris Botsis wrote: > Hi again, > what I try now is get the non-SSL OverByteIcsHttpDemo, and instead > "Go" button calling httpcli component, it calls an sslhttpcli > component (I also added a proper sslcontext component) so code became > : > > procedure THttpToMemoForm.GoButtonClick(Sender: TObject); > var > Data : TMemoryStream; > begin > DisplayMemo.Clear; > > GoButton.Enabled := FALSE; > Data := TMemoryStream.Create; > try > sslhttpcli1.URL:= URLEdit.Text; > //httpcli1.Proxy := ProxyEdit.Text; > //httpcli1.ProxyPort := '80'; > sslhttpcli1.RcvdStream := Data; > sslhttpcli1.Get; > LoadMemoFromMemoryStream(DisplayMemo, Data); > finally > Data.Free; > GoButton.Enabled := TRUE; > end; > end; > > As URLEdit1.Text, I set the whole URL up to the file, so it's like : > https://www.mydomain.com/myfile.txt > > Can someone please explain or find why this does not work ? Show us your code in LoadMemoFromMemoryStream. It makes no difference whether you use a TFile or TMemorystream. Maybe you simply forgot to rewind the stream before the memo loads it? -- Arno Garrels -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Receive contents of remote text file over SSL
On 12/4/2011 7:18 μμ, Dimitris Botsis wrote: On 12/4/2011 5:12 μμ, Dimitris Botsis wrote: On 12/4/2011 5:04 μμ, Dimitris Botsis wrote: On 12/4/2011 4:40 μμ, Arno Garrels wrote: Dimitris Botsis wrote: Hi again, I use the example "OverbyteIcsHttpDmo". When I call the text file on my web server using HTTP (as in the example) then I get the contents OK. When I use HTTPS (having added proper sslhttpcli and sslcontect components) the request is sent but don't get any contents back. Any ideas ? Does the server support HTTPS? If yes, try with the OverbyteIcsHttpsTst demo in SslInternet folder. If that works search for differences in your code, otherwise the demo should log error messages. Of course the server supports HTTPS, if I use web browser it's all OK. I tried OverbyteIcsHttpsTst demo but without luck. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be Sorry, it's OK - the example works fine. I used some wrong predefined directives I had added and screw some things before... Thank you very much -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be Sorry again but there is still a small problem : The example mentioned stores the downloaded remote file locally and then (OnRequestDone) loads it again in order to display the contents of the file in the TMemo. I see that the whole "problem" is because of streams. How can I have the same result like in example but without saving transferred content to external file ? I tried using MemoryStream or StringStream instead but whole think does not work. Thank you. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be Hi again, what I try now is get the non-SSL OverByteIcsHttpDemo, and instead "Go" button calling httpcli component, it calls an sslhttpcli component (I also added a proper sslcontext component) so code became : procedure THttpToMemoForm.GoButtonClick(Sender: TObject); var Data : TMemoryStream; begin DisplayMemo.Clear; GoButton.Enabled := FALSE; Data := TMemoryStream.Create; try sslhttpcli1.URL:= URLEdit.Text; //httpcli1.Proxy := ProxyEdit.Text; //httpcli1.ProxyPort := '80'; sslhttpcli1.RcvdStream := Data; sslhttpcli1.Get; LoadMemoFromMemoryStream(DisplayMemo, Data); finally Data.Free; GoButton.Enabled := TRUE; end; end; As URLEdit1.Text, I set the whole URL up to the file, so it's like : https://www.mydomain.com/myfile.txt Can someone please explain or find why this does not work ? It's exactly the same like non-SSL version. Thank you. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Receive contents of remote text file over SSL
On 12/4/2011 5:12 μμ, Dimitris Botsis wrote: On 12/4/2011 5:04 μμ, Dimitris Botsis wrote: On 12/4/2011 4:40 μμ, Arno Garrels wrote: Dimitris Botsis wrote: Hi again, I use the example "OverbyteIcsHttpDmo". When I call the text file on my web server using HTTP (as in the example) then I get the contents OK. When I use HTTPS (having added proper sslhttpcli and sslcontect components) the request is sent but don't get any contents back. Any ideas ? Does the server support HTTPS? If yes, try with the OverbyteIcsHttpsTst demo in SslInternet folder. If that works search for differences in your code, otherwise the demo should log error messages. Of course the server supports HTTPS, if I use web browser it's all OK. I tried OverbyteIcsHttpsTst demo but without luck. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be Sorry, it's OK - the example works fine. I used some wrong predefined directives I had added and screw some things before... Thank you very much -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be Sorry again but there is still a small problem : The example mentioned stores the downloaded remote file locally and then (OnRequestDone) loads it again in order to display the contents of the file in the TMemo. I see that the whole "problem" is because of streams. How can I have the same result like in example but without saving transferred content to external file ? I tried using MemoryStream or StringStream instead but whole think does not work. Thank you. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Receive contents of remote text file over SSL
On 12/4/2011 5:04 μμ, Dimitris Botsis wrote: On 12/4/2011 4:40 μμ, Arno Garrels wrote: Dimitris Botsis wrote: Hi again, I use the example "OverbyteIcsHttpDmo". When I call the text file on my web server using HTTP (as in the example) then I get the contents OK. When I use HTTPS (having added proper sslhttpcli and sslcontect components) the request is sent but don't get any contents back. Any ideas ? Does the server support HTTPS? If yes, try with the OverbyteIcsHttpsTst demo in SslInternet folder. If that works search for differences in your code, otherwise the demo should log error messages. Of course the server supports HTTPS, if I use web browser it's all OK. I tried OverbyteIcsHttpsTst demo but without luck. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be Sorry, it's OK - the example works fine. I used some wrong predefined directives I had added and screw some things before... Thank you very much -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Receive contents of remote text file over SSL
On 12/4/2011 4:40 μμ, Arno Garrels wrote: Dimitris Botsis wrote: Hi again, I use the example "OverbyteIcsHttpDmo". When I call the text file on my web server using HTTP (as in the example) then I get the contents OK. When I use HTTPS (having added proper sslhttpcli and sslcontect components) the request is sent but don't get any contents back. Any ideas ? Does the server support HTTPS? If yes, try with the OverbyteIcsHttpsTst demo in SslInternet folder. If that works search for differences in your code, otherwise the demo should log error messages. Of course the server supports HTTPS, if I use web browser it's all OK. I tried OverbyteIcsHttpsTst demo but without luck. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Receive contents of remote text file over SSL
Dimitris Botsis wrote: > Hi again, > > I use the example "OverbyteIcsHttpDmo". When I call the text file on > my web server using HTTP (as in the example) then I get the contents > OK. When I use HTTPS (having added proper sslhttpcli and sslcontect > components) the request is sent but don't get any contents back. > Any ideas ? Does the server support HTTPS? If yes, try with the OverbyteIcsHttpsTst demo in SslInternet folder. If that works search for differences in your code, otherwise the demo should log error messages. -- Arno Garrels -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Receive contents of remote text file over SSL
Hi again, I use the example "OverbyteIcsHttpDmo". When I call the text file on my web server using HTTP (as in the example) then I get the contents OK. When I use HTTPS (having added proper sslhttpcli and sslcontect components) the request is sent but don't get any contents back. Any ideas ? On 12/4/2011 2:38 μμ, Dimitris Botsis wrote: Hi all, how can i use SSLHttpCli in order to directly transfer the contents of a remote text file ? Which are filesize limitations for that ? For example, I have a file : https://www.mydomain.com/myfile.txt and want to read it directly to client. Thank you. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be