/* * Demonstration TLS client * * Compile with * * gcc -Wall -o tls_client tls_client.c -L/usr/lib -lssl -lcrypto * * Execute with * * ./tls_client * * Generate certificate with * * openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout tls_demonstration_cert.pem -out tls_demonstration_cert.pem * * Developed for Intel Edison IoT Curriculum by UCLA WHI */ #include #include #ifndef __VMS #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define BUFSIZE 1024 #define AVERAGE_HEART_RATE 70.0 double generate_random_number(double lower, double upper); char * get_ip_addr(); int open_port(const char *server_name, int server_port); SSL_CTX *initialize_client_CTX(void); void display_server_certificate(SSL * ssl);