Bonjour à tous,
Je compile en C avec Code::Blocks sous Ubuntu. Je voudrais effectuer une conexion ssl cliente avec OpenSSL et j'ai trouver
un exelent tutoriel. Malheuresement lorsque je compile le debugger me dit:
26 Undefined reference to 'BIO_new_connect'
26 Undefined reference to 'BIO_ctrl'
Je comprends pas, voici mon code:
Code C/C++ :
#include <stdio.h>
#include <stdlib.h>
/* OpenSSL headers */
#include "openssl/bio.h"
#include "openssl/ssl.h"
#include "openssl/err.h"
/* Initializing OpenSSL */
SSL_load_crypto_strings();
SSL_library_init();
int create_ssl_client(const char *hostname, int port);
int main()
{
printf("Conexion ssl: \n");
return 0;
}
int create_ssl_client(const char *hostname, int port)
{
BIO *bio;
bio = BIO_new_connect("www.ibm.com:80");
if(bio == NULL)
{
printf("Une erreur est survenu !\n");
}
if(BIO_do_connect(bio) <= 0)
{
printf("Connexion impossible !");
}
return 0;
}
Merci de vos réponses
Try not ! Do or do not ! There is not try !