Re: [DUG] Testing internet web site connections

2016-10-12 Thread John Bird
Thanks for that, looks like what I was doing, the issues must be with the 
correct versions of DLLs

From: Ross Levis 
Sent: Thursday, October 13, 2016 12:57 AM
To: 'NZ Borland Developers Group - Delphi List' 
Subject: Re: [DUG] Testing internet web site connections

Regarding code, here is some.

 

var

  Ret: string;

  aHTTP: TIdHTTP;

  SSLHandler: TIdSSLIOHandlerSocketOpenSSL;

begin

  aHTTP := TIdHTTP.Create;

  if SameText('https:',copy(URL,1,6)) then

  begin

SSLHandler := TIdSSLIOHandlerSocketOpenSSL.Create(aHTTP);

SSLHandler.SSLOptions.Method := sslvSSLv23;

aHTTP.IOHandler := SSLHandler;

  end;

  try

Ret := aHTTP.Get(URL);

Success := True

  except

Success := False

  end;

 

For a specific code I think you may access aHTTP.LastCmdResult.Code.

 

Ross.

 

From: Ross Levis [mailto:r...@stationplaylist.com] 
Sent: Thursday, 13 October 2016 12:48 a.m.
To: 'NZ Borland Developers Group - Delphi List'
Subject: RE: [DUG] Testing internet web site connections

 

With a 32-bit compiler you need the 32-bit editions of OpenSSL DLLs installed.  
They usually go to Windows\System32.  I instruct my users to download the Light 
edition on this website.

 

http://slproweb.com/products/Win32OpenSSL.html

 

Ross.

 

From: delphi-boun...@listserver.123.net.nz 
[mailto:delphi-boun...@listserver.123.net.nz] On Behalf Of John Bird
Sent: Wednesday, 12 October 2016 9:30 p.m.
To: NZ Borland Developers Group - Delphi List
Subject: [DUG] Testing internet web site connections

 

I have been considering writing something to monitor connectivity to a few web 
sites- note not detecting whether there is an internet connection, but whether 
a number of sites are responding.  Some http and some https.

 

(Have got tired of opening a CMD prompt and pinging sites)

 

I have experimented with this in Indy for Delphi 2007 and testing a http site 
seems simple.   https is a little more involved – has to have the right OpenSSL 
DLLs in the program’s folder, libeay32.dll and ssleay32.dll and I am not sure 
which is the right versions for D2007 to get from https://indy.fulgan.com/SSL/  
- for instance D2007 is 32 bit but windows is 64bit, and which version for 
which Delphi – there are new versions from V0.9.8r to v1.0.2j.  So far just 
getting “could not load SSL library” and “error creating SSL context”

 

Indy seems quite ideal, being asynchronous, doesn’t matter if it takes a while.

 

I could instead do Indy in Delphi Berlin, or use the non-Indy native internet 
connectivity in Berlin but haven’t found useful sample code as a guide for 
that.   

 

Any recommendations out there of best tools to use/point me to simple sample 
code.   Happy just to get as far as a 200 returned or 404 etc.




___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@listserver.123.net.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@listserver.123.net.nz with 
Subject: unsubscribe___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@listserver.123.net.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@listserver.123.net.nz with 
Subject: unsubscribe

Re: [DUG] Testing internet web site connections

2016-10-12 Thread Jolyon Direnko-Smith
I'm not normally a fan of Microsoft, but it has to be said that if your web
sites are hosted in Azure then you get more alerts and monitoring
capabilities than you can shake a stick at.  They won't just tell you
whether your site is up, down or sideways but can also notify you when it
is responding but more slowly than usual/expected.

Of course, this only helps if they are your own web sites you are concerned
with and the sites are able to be hosted in Azure.  :)
___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@listserver.123.net.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@listserver.123.net.nz with 
Subject: unsubscribe

Re: [DUG] Testing internet web site connections

2016-10-12 Thread Ross Levis
Regarding code, here is some.

 

var

  Ret: string;

  aHTTP: TIdHTTP;

  SSLHandler: TIdSSLIOHandlerSocketOpenSSL;

begin

  aHTTP := TIdHTTP.Create;

  if SameText('https:',copy(URL,1,6)) then

  begin

SSLHandler := TIdSSLIOHandlerSocketOpenSSL.Create(aHTTP);

SSLHandler.SSLOptions.Method := sslvSSLv23;

aHTTP.IOHandler := SSLHandler;

  end;

  try

Ret := aHTTP.Get(URL);

Success := True

  except

Success := False

  end;

 

For a specific code I think you may access aHTTP.LastCmdResult.Code.

 

Ross.

 

From: Ross Levis [mailto:r...@stationplaylist.com] 
Sent: Thursday, 13 October 2016 12:48 a.m.
To: 'NZ Borland Developers Group - Delphi List'
Subject: RE: [DUG] Testing internet web site connections

 

With a 32-bit compiler you need the 32-bit editions of OpenSSL DLLs installed.  
They usually go to Windows\System32.  I instruct my users to download the Light 
edition on this website.

 

http://slproweb.com/products/Win32OpenSSL.html

 

Ross.

 

From: delphi-boun...@listserver.123.net.nz 
[mailto:delphi-boun...@listserver.123.net.nz] On Behalf Of John Bird
Sent: Wednesday, 12 October 2016 9:30 p.m.
To: NZ Borland Developers Group - Delphi List
Subject: [DUG] Testing internet web site connections

 

I have been considering writing something to monitor connectivity to a few web 
sites- note not detecting whether there is an internet connection, but whether 
a number of sites are responding.  Some http and some https.

 

(Have got tired of opening a CMD prompt and pinging sites)

 

I have experimented with this in Indy for Delphi 2007 and testing a http site 
seems simple.   https is a little more involved – has to have the right OpenSSL 
DLLs in the program’s folder, libeay32.dll and ssleay32.dll and I am not sure 
which is the right versions for D2007 to get from https://indy.fulgan.com/SSL/  
- for instance D2007 is 32 bit but windows is 64bit, and which version for 
which Delphi – there are new versions from V0.9.8r to v1.0.2j.  So far just 
getting “could not load SSL library” and “error creating SSL context”

 

Indy seems quite ideal, being asynchronous, doesn’t matter if it takes a while.

 

I could instead do Indy in Delphi Berlin, or use the non-Indy native internet 
connectivity in Berlin but haven’t found useful sample code as a guide for 
that.   

 

Any recommendations out there of best tools to use/point me to simple sample 
code.   Happy just to get as far as a 200 returned or 404 etc.

___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@listserver.123.net.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@listserver.123.net.nz with 
Subject: unsubscribe

Re: [DUG] Testing internet web site connections

2016-10-12 Thread Ross Levis
With a 32-bit compiler you need the 32-bit editions of OpenSSL DLLs installed.  
They usually go to Windows\System32.  I instruct my users to download the Light 
edition on this website.

 

http://slproweb.com/products/Win32OpenSSL.html

 

Ross.

 

From: delphi-boun...@listserver.123.net.nz 
[mailto:delphi-boun...@listserver.123.net.nz] On Behalf Of John Bird
Sent: Wednesday, 12 October 2016 9:30 p.m.
To: NZ Borland Developers Group - Delphi List
Subject: [DUG] Testing internet web site connections

 

I have been considering writing something to monitor connectivity to a few web 
sites- note not detecting whether there is an internet connection, but whether 
a number of sites are responding.  Some http and some https.

 

(Have got tired of opening a CMD prompt and pinging sites)

 

I have experimented with this in Indy for Delphi 2007 and testing a http site 
seems simple.   https is a little more involved – has to have the right OpenSSL 
DLLs in the program’s folder, libeay32.dll and ssleay32.dll and I am not sure 
which is the right versions for D2007 to get from https://indy.fulgan.com/SSL/  
- for instance D2007 is 32 bit but windows is 64bit, and which version for 
which Delphi – there are new versions from V0.9.8r to v1.0.2j.  So far just 
getting “could not load SSL library” and “error creating SSL context”

 

Indy seems quite ideal, being asynchronous, doesn’t matter if it takes a while.

 

I could instead do Indy in Delphi Berlin, or use the non-Indy native internet 
connectivity in Berlin but haven’t found useful sample code as a guide for 
that.   

 

Any recommendations out there of best tools to use/point me to simple sample 
code.   Happy just to get as far as a 200 returned or 404 etc.

___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@listserver.123.net.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@listserver.123.net.nz with 
Subject: unsubscribe

Re: [DUG] Testing internet web site connections

2016-10-12 Thread David Moorhouse
Hi JB

Stay away from OpenSSL :)
The problem using it for SSL is that you have to keep the DLLs up to 
date as new security vulnerabilities are uncovered. With native API 
calls updates to the OS should patch any security issues.

The native HTTP Client controls work well.  As they map to the 
underlying OS API, you could write this to run on Windows and then port 
it across to, a Mac Mini for example :)  Sound familiar ?

I can show you some code samples tomorrow at Oktoberfest.

Cheers

D

On 12/10/16 22:20, Jeremy Coulter wrote:
> JB, make sure you are using the latest Open SSL DLLs as the earlier ones
> had security vulnerabilities.
>
> Jeremy
>
>
> On Wed, Oct 12, 2016 at 9:30 PM, John Bird  > wrote:
>
> I have been considering writing something to monitor connectivity to
> a few web sites- note not detecting whether there is an internet
> connection, but whether a number of sites are responding.  Some http
> and some https.
>
> (Have got tired of opening a CMD prompt and pinging sites)
>
> I have experimented with this in Indy for Delphi 2007 and testing a
> http site seems simple.   https is a little more involved – has to
> have the right OpenSSL DLLs in the program’s folder, libeay32.dll
> and ssleay32.dll and I am not sure which is the right versions for
> D2007 to get from https://indy.fulgan.com/SSL/  - for instance D2007
> is 32 bit but windows is 64bit, and which version for which Delphi –
> there are new versions from V0.9.8r to v1.0.2j.  So far just getting
> “could not load SSL library” and “error creating SSL context”
>
> Indy seems quite ideal, being asynchronous, doesn’t matter if it
> takes a while.
>
> I could instead do Indy in Delphi Berlin, or use the non-Indy native
> internet connectivity in Berlin but haven’t found useful sample code
> as a guide for that.
>
> Any recommendations out there of best tools to use/point me to
> simple sample code.   Happy just to get as far as a 200 returned or
> 404 etc.
>
> ___
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi@listserver.123.net.nz 
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> 
> Unsubscribe: send an email to delphi-requ...@listserver.123.net.nz
>  with Subject: unsubscribe
>
>
>
>
> ___
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi@listserver.123.net.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-requ...@listserver.123.net.nz with 
> Subject: unsubscribe
>


___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@listserver.123.net.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@listserver.123.net.nz with 
Subject: unsubscribe


Re: [DUG] Testing internet web site connections

2016-10-12 Thread Jeremy Coulter
JB, make sure you are using the latest Open SSL DLLs as the earlier ones
had security vulnerabilities.

Jeremy


On Wed, Oct 12, 2016 at 9:30 PM, John Bird 
wrote:

> I have been considering writing something to monitor connectivity to a few
> web sites- note not detecting whether there is an internet connection, but
> whether a number of sites are responding.  Some http and some https.
>
> (Have got tired of opening a CMD prompt and pinging sites)
>
> I have experimented with this in Indy for Delphi 2007 and testing a http
> site seems simple.   https is a little more involved – has to have the
> right OpenSSL DLLs in the program’s folder, libeay32.dll and ssleay32.dll
> and I am not sure which is the right versions for D2007 to get from
> https://indy.fulgan.com/SSL/  - for instance D2007 is 32 bit but windows
> is 64bit, and which version for which Delphi – there are new versions from
> V0.9.8r to v1.0.2j.  So far just getting “could not load SSL library” and
> “error creating SSL context”
>
> Indy seems quite ideal, being asynchronous, doesn’t matter if it takes a
> while.
>
> I could instead do Indy in Delphi Berlin, or use the non-Indy native
> internet connectivity in Berlin but haven’t found useful sample code as a
> guide for that.
>
> Any recommendations out there of best tools to use/point me to simple
> sample code.   Happy just to get as far as a 200 returned or 404 etc.
>
> ___
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi@listserver.123.net.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-requ...@listserver.123.net.nz with
> Subject: unsubscribe
>
___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@listserver.123.net.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@listserver.123.net.nz with 
Subject: unsubscribe