[AWS] AWS.Client HTTPS connections

Pascal Obry p.obry@wanadoo.fr
Sun, 23 Nov 2003 22:10:15 +0100


Ben,

 > That did the trick. Thanks, Pascal!

Good to hear.

 > It's hard to wade through all the AWS.Server docs when you haven't 
 > built one and are just familiar with AWS.Client. Also, the AWS.Client 
 > docs make no mention of AWS.Net.SSL. I'm going to write up an addition 
 > to the AWS.Client document page with sample code for making an HTTPS 
 > connection.

Ok.

 > Some new questions:
 > 
 > - Can I freely use/redistribute "demos/cert.pem"?

Yes but this is a dummy certificate. You need to pay for one to a real
security authority. This one is just good for demo and private use.

 > - Building a webclient using AWS, I want to set the User-Agent string. 
 > Is there any way to do that?

No this is hard coded into aws-client.adb.

 > The following snippet has all my relevant HTTPS code. It's really very 
 > simple. Do you see any problems?
 > 
 > ------------------------------------------------------
 > 	with Ada.Text_IO;    use Ada.Text_IO;
 > 
 > 	with AWS.Client;
 > 	with AWS.Response;
 > 	with AWS.Net.SSL;
 > 
 > 	procedure HTTPS_Test is
 > 	      Resp : AWS.Response.Data;
 > 	begin
 > 	      AWS.Net.SSL.Initialize ("aws-1.4/demos/cert.pem");
 > 
 > 	      Resp := AWS.Client.Get ("https://secure_site.com");
 > 
 > 	      Put_Line (AWS.Response.Message_Body (Resp));
 > 	end HTTPS_Test;
 > ------------------------------------------------------

Looks good to me.

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595