Re: Using the SSL module.

Henrik Grubbström <[email protected]>
Newsgroups gmane.comp.lang.pike.user
Organization Roxen Internet Software AB
Message-ID <[email protected]>
On Tue, 23 Jun 2015, Chris Angelico wrote:

> On Mon, Jun 22, 2015 at 8:03 PM, Henrik Grubbström <[email protected]> wrote:
>>> int main()
>>> {
>>>     Stdio.File sock = Stdio.File();
>>>     sock->connect("gideon.rosuav.com", 443);
>>>     SSL.File ssl = SSL.File(sock, SSL.Context());
>>
>> Note that with Pike 8.0 and later I believe that you need to also call
>> ssl->connect("gideon.rosuav.com") here.
>>
>>>     ssl->write("GET / HTTP/1.0\r\n\r\n");
>>>     write("Response:\n%s\n", ssl->read(1024,1));
>>> }
>
> Interesting. I just tried with and without that on 8.1.2ish (latest
> from git as of a few days ago), and it didn't fail, but it didn't
> change anything. Is that to do with the SNI extension?

Yes, the argument is passed along to the SNI extension, but it also 
sets up the low-level SSL state for operation as a client, which 
includes queueing the initial client hello message for sending, so 
I don't see how you could have it work without the call.

 	/grubba

-- 
Henrik Grubbström					[email protected]
Roxen Internet Software AB
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.