hi, is just started and have e few questions...

#1
        char *ERR_lib_error_string(unsigned long e);
        char *ERR_func_error_string(unsigned long e);
        char *ERR_reason_error_string(unsigned long e);

The thing i want to do is acces the flags from the errorbuffer, but this is
not accessabe (NT -DLL), 
i could create a function that does that, like

        char *ERR_flag_error_string(char *buf, const int buf_len)

or is there  an other way to acces it (in a string and not in a stream (
ERR_print_errors_fp(stderr) ) that i overlooked?

#2

is there a way to get the new BIO * after an accept(in such a way that the
waiting 4 a new connection
is in the accept and not in the BIO_read(..)? i now have the problem that i
have to wait once till
i get some data, and then i can get the new BIO *, to the new connection.
(see source at end)

#3 

is there more documentation or sample source availible? I've just started,
but cannot find alot of information, and
in my humble opion are the header files not that clear.


Groeten,


Eduard Witteveen
__________________________________________

Email:  [EMAIL PROTECTED]
Phone:  +31 (0)50 58 22610      (work)
        +31 (0)50 52 53538      (home) 
ICQ  :  32721156
__________________________________________

 Quis custodiet ipsos custodes?
 - Juvenal, Satires, VI, 347
__________________________________________

<<sslserver.h>>

// not very interresting... only that
BIO *m_incoming is in class sslServer..

<<sslserver.cpp>>

#include <sol\ssl\sslServer.h>


sslServer::sslServer() throw (SslException)
{
        m_incoming = NULL;
}


sslServer::~sslServer()
{
        // close the shit ...
        // take a further look in examples, and members
}

void sslServer::listen(const char *port) throw (SslException)
{
        SSL *ssl;
        BIO *ssl_bio;
        
        ssl=SSL_new(m_ctx);
        ssl_bio=BIO_new_ssl(m_ctx,0);

        if ((m_incoming=BIO_new_accept((char *)port)) == NULL) 
                throwSslException(HERE);

        BIO_set_accept_bios(m_incoming, ssl_bio);
}

void sslServer::accept() throw (SslException)
{
        BIO *new_connection;
        char buf[512];
        int i;

        if (BIO_do_accept(m_incoming) <= 0) 
                throwSslException(HERE);

        i=BIO_read(m_incoming,buf,512);
        new_connection = BIO_pop(m_incoming);
        if (i == 0)
        {
                printf("Done\n");
                BIO_free_all(new_connection);
        }
        if (i < 0)
                throwSslException(HERE);

        fwrite(buf,1,i,stdout);
        fflush(stdout);
        char p[300]= ("Hello from server !!!\r\n");
        int len=strlen(p);

        printf("Gonna write.....\n");
        i=BIO_write(new_connection, p, len);
        printf("Done\n");
        BIO_free_all(new_connection);
}
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to