aca me encontre como compilar
Openssl con c++Builder 5
http://rudeserver.co...sltutorial.html
logre compilarlo
tal cual
ahora no se como completar lo que el autor da como obvio.
crear un socket stream con c++ builder o c++
aqui el codigo para probar que todo saldio bien
cpp
#include <openssl/crypto.h> #include <openssl/x509.h> #include <openssl/pem.h> #include <openssl/ssl.h> #include <openssl/err.h>
- Add the following include directives to the application:
- Create a SOCKET and connect to an https server on port 443 like you normally would....
- Assuming your socket is named sock, you then perform your ssl communications like this:cpp
- SOCKET sock;//JUSTO AQUI NO SE COMO CREAR EL SOCK_STREAM ayuda por favor
- // build regular SOCK_STREAM sock and connect to server
- // ... (I'm not going into these details)
- // pretend sock is now connected....
- // here's the data items we'll use....
- char buf[1000];
- char request[1000];
- SSL_CTX *ctx;
- SSL *ssl;
- int err;
- // initialize SSL stuff
- SSL_load_error_strings();
- SSL_library_init();
- // build the SSL objects...
- ctx=SSL_CTX_new(SSLv2_client_method());
- ssl=SSL_new(ctx);
- // assign the socket you created for SSL to use
- SSL_set_fd(ssl, sock);
- // communicate!! /////////////////////////////////////////////
- err=SSL_connect(ssl);
- sprintf(request, "GET %s HTTP/1.0\r\nHost: %s\r\n\r\n","/" , "www.theserver.com");
- err=SSL_write(ssl, request, strlen(request));
- while(1){
- int read_size;
- read_size=SSL_read(ssl, buf, sizeof(buf)-1);
- buf[read_size]='\0';
- if(read_size > 0){
- // I'm assuming you have a Memo object
- //on your application form...
- Memo1->SetSelTextBuf(buf);
- }
- else{
- break;
- }
- }
- // free the SSL stuff....
- SSL_shutdown(ssl);
- SSL_free(ssl);
- SSL_CTX_free(ctx);
- ya ando buscando con que servidor probar el socket creado.
¿alguna servidor que suguieran para probar el codigo?
gracias