SSL/HTTPS Stream.

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

SSL/HTTPS Stream.

David-15
Hello.
 
I am trying to connect to a secure (https) webserver using PHP.  The problem is that PHP needs to have https as a registered stream (which it doesnt).  I have installed OpenSSL, and enabled the extensions in PHP.
 
Can I assume that OpenSSL doesnt add https as a registered stream, or have I messed something up?
 
Thank you!
Reply | Threaded
Open this post in threaded view
|

Re: SSL/HTTPS Stream.

Joseph Oreste Bruni
This is also a function of your web server. If you are running Apache  
you can use "mod_ssl".

On May 28, 2005, at 7:47 AM, David wrote:

> Hello.
>
> I am trying to connect to a secure (https) webserver using PHP.  
> The problem is that PHP needs to have https as a registered stream  
> (which it doesnt).  I have installed OpenSSL, and enabled the  
> extensions in PHP.
>
> Can I assume that OpenSSL doesnt add https as a registered stream,  
> or have I messed something up?
>
> Thank you!
>


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Checking for socket read state

PJ-7
Hi all quick question of you guru's.

If I wish to check to see if data is ready to be read on my SSL connection
do I just use normal "select" or is there something in the SSL libraries
that I need to use?

I normally use the function below:

int CheckRead(SOCKET socket)
{
        struct timeval stTimeOut;
        fd_set stReadFDS;
        fd_set stErrorFDS;

        FD_ZERO(&stReadFDS);
        FD_ZERO(&stErrorFDS);

        FD_SET(socket,&stReadFDS);
        FD_SET(socket,&stErrorFDS);

        stTimeOut.tv_sec=0;
        stTimeOut.tv_usec=0;

        int i;
        i = select(0,&stReadFDS,NULL,&stErrorFDS,&stTimeOut);
        if (i)
        {
                if (FD_ISSET(socket,&stReadFDS))
                        return 1;
        }
        return 0;
}


Thanks!
Pj.

 

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.322 / Virus Database: 267.3.0 - Release Date: 30/05/2005
 

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

RE: Checking for socket read state

JoelKatz

> Hi all quick question of you guru's.
>
> If I wish to check to see if data is ready to be read on my SSL connection
> do I just use normal "select" or is there something in the SSL libraries
> that I need to use?

        You aren't asking a precise question. For example, if there's data that
could be read on the socket, but it's just a chunk of SSL protocol data with
no application data, does that mean data is ready to be read? Or not? If you
want to tell if there's data that the kernel has received over the network
that the SSL engine has not yet processed, 'select' can tell you that. Or
are you trying to find out if there's data that's ready for the application
that's already been processed by SSL? Or are you trying to tell if you
should ask the SSL engine to process data in the hopes of producing data for
the application to read?

        DS


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

RE: Checking for socket read state

PJ-7
Ok...

Sorry, maybe that was the wrong question altogether...
I am trying to signal my blocking connection thread to end while OpenSSL is
negotiating a connection with SSL_connect.

Is there any way to tell SSL to stop once it enters SSL_connect, perhaps
with a non-blocking approach?

Pseudocode Eg:

////////////////////////////////////////

SSL_connect
While not connected and not signalled
        Sleep(1)
Wend
If signalled exit

...
SSL_get_peer_certificate
...
Send data
...
/////////////////////////////////////////

What is happening is that my application blocks until the SSL negotiation
takes place.

Thanks!
Pj.




-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of David Schwartz
Sent: Tuesday, 31 May 2005 2:00 PM
To: [hidden email]
Subject: RE: Checking for socket read state


> Hi all quick question of you guru's.
>
> If I wish to check to see if data is ready to be read on my SSL connection
> do I just use normal "select" or is there something in the SSL libraries
> that I need to use?

        You aren't asking a precise question. For example, if there's data
that
could be read on the socket, but it's just a chunk of SSL protocol data with
no application data, does that mean data is ready to be read? Or not? If you
want to tell if there's data that the kernel has received over the network
that the SSL engine has not yet processed, 'select' can tell you that. Or
are you trying to find out if there's data that's ready for the application
that's already been processed by SSL? Or are you trying to tell if you
should ask the SSL engine to process data in the hopes of producing data for
the application to read?

        DS


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]

--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.322 / Virus Database: 267.3.0 - Release Date: 30/05/2005
 

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.322 / Virus Database: 267.3.0 - Release Date: 30/05/2005
 

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

RE: Checking for socket read state

JoelKatz

> Ok...
>
> Sorry, maybe that was the wrong question altogether...
> I am trying to signal my blocking connection thread to end while
> OpenSSL is
> negotiating a connection with SSL_connect.
>
> Is there any way to tell SSL to stop once it enters SSL_connect, perhaps
> with a non-blocking approach?

        It's not pretty, but you could 'shutdown' the TCP connection.

        DS


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]