Re: Fwd: client using ssl

Jan Wielemaker <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
On 01/16/2014 08:52 PM, Josef Frydl wrote:
> Even this call fails
> ?-  open('/Users/joseffrydl/Desktop/proKatu/p.txt', write, S),
> |        Search= 'https://ajax.googleapis.com/ajax/services/search/web?v=1.0&rsz=large&q=Josef Frydl Westminster&start=0',
> |        http_open(Search, In,
> |                        [cert_verify_hook(cert_verify),status_code(Code),
> |    cacert_file('/Users/joseffrydl/Desktop/proKatu/needed/cacert.pem'),
> |    certificate_file('/Users/joseffrydl/Desktop/proKatu/needed/client-cert.pem'),
> |    key_file('/Users/joseffrydl/Desktop/proKatu/needed/client-key.pem')
> |                       ]),copy_stream_data(In, S),close(In),close(S).
> Debug: SSL error report:
> 	    code: 14090086
> 	 library: SSL routines
> 	function: SSL3_GET_SERVER_CERTIFICATE
> 	  reason: certificate verify failed
> Unrecoverable error: 5
> Additionally, get_error returned 0

These are surely a bit contradictive options.  It you specify the
cert_verify_hook
option, you say you're going to do the validation yourself.   At the
same time you
provide the locations of the data files to allow the library doing its
job.  Look
at the source code to see what happens.  From the log, it seems it is
ignoring the
hook.  Using only the hook surely works.  See e.g., the prolog_pack library.

	Cheers --- Jan

> 
> 
> Begin forwarded message:
> 
>> From: Josef Frydl <[email protected]>
>> Date: January 16, 2014 2:15:12 PM EST
>> To: [email protected]
>> Subject: client using ssl
>>
>> I have stable version:
>> elcome to SWI-Prolog (Multi-threaded, 32 bits, Version 6.6.1)
>> Copyright (c) 1990-2013 University of Amsterdam, VU Amsterdam
>> SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software,
>> and you are welcome to redistribute it under certain conditions.
>> Please visit http://www.swi-prolog.org for details.
>> Pasted this
>> cert_verify(_SSL, _ProblemCert, _AllCerts, _FirstCert, _Error) :-
>>        format(user_error, 'Accepting certificate~n', []).
>>
>> But still can not use ssl
>>
>> ?- open('/Users/joseffrydl/Desktop/proKatu/p.txt', write, S),
>> |    Search= 'https://ajax.googleapis.com/ajax/services/search/web?v=1.0&rsz=large&q=Josef Frydl Westminster&start=0',
>> |    http_open(Search, In, [cert_verify_hook(cert_verify),status_code(Code)]),
>> |    copy_stream_data(In, S),close(In),close(S).
>> Debug: SSL error report:
>> 	    code: 14090086
>> 	 library: SSL routines
>> 	function: SSL3_GET_SERVER_CERTIFICATE
>> 	  reason: certificate verify failed
>> Unrecoverable error: 5
>> Additionally, get_error returned 0
>> URL works nucely from browser.
>> Are there some other steps I have to do?
>>
>> in addition does anybody knows searcg engine, that can be used in http_open calls
>>
>> Thanks Josef Frydl
>>
>>
> 
> -------------- next part --------------
> HTML attachment scrubbed and removed
> _______________________________________________
> SWI-Prolog mailing list
> [email protected]
> https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.