keith-cullen / FreeCoAP

An implementation of a CoAP client, a CoAP server and a HTTP/CoAP proxy with full DTLS support.
132 stars 38 forks source link

test_http_client #6

Closed sheraz045 closed 7 years ago

sheraz045 commented 7 years ago

user@instant-contiki:~/Desktop/FreeCoAP-master/FreeCoAP-master/test/test_http_client$ make ip6=y make: `test_http_client' is up to date. user@instant-contiki:~/Desktop/FreeCoAP-master/FreeCoAP-master/test/test_http_client$ ./test_http_client Error : unable to load TLS credentials user@instant-contiki:~/Desktop/FreeCoAP-master/FreeCoAP-master/test/test_http_client$ make clean /bin/rm -f test_http_client test_http_client.o http_msg.o tls.o sock.o tls_sock.o data_buf.o util.o coap_log.o test.o user@instant-contiki:~/Desktop/FreeCoAP-master/FreeCoAP-master/test/test_http_client$ make ip6=y gcc -DSOCK_IP6 -Wall -I../../lib/include -I../../proxy/common/include -I.. -DTLS_CLIENT_AUTH -c test_http_client.c gcc -DSOCK_IP6 -Wall -I../../lib/include -I../../proxy/common/include -I.. -DTLS_CLIENT_AUTH -c ../../proxy/common/src/http_msg.c gcc -DSOCK_IP6 -Wall -I../../lib/include -I../../proxy/common/include -I.. -DTLS_CLIENT_AUTH -c ../../proxy/common/src/tls.c gcc -DSOCK_IP6 -Wall -I../../lib/include -I../../proxy/common/include -I.. -DTLS_CLIENT_AUTH -c ../../proxy/common/src/sock.c gcc -DSOCK_IP6 -Wall -I../../lib/include -I../../proxy/common/include -I.. -DTLS_CLIENT_AUTH -c ../../proxy/common/src/tls_sock.c gcc -DSOCK_IP6 -Wall -I../../lib/include -I../../proxy/common/include -I.. -DTLS_CLIENT_AUTH -c ../../proxy/common/src/data_buf.c gcc -DSOCK_IP6 -Wall -I../../lib/include -I../../proxy/common/include -I.. -DTLS_CLIENT_AUTH -c ../../proxy/common/src/util.c gcc -DSOCK_IP6 -Wall -I../../lib/include -I../../proxy/common/include -I.. -DTLS_CLIENT_AUTH -c ../../lib/src/coap_log.c gcc -DSOCK_IP6 -Wall -I../../lib/include -I../../proxy/common/include -I.. -DTLS_CLIENT_AUTH -c ../test.c gcc test_http_client.o http_msg.o tls.o sock.o tls_sock.o data_buf.o util.o coap_log.o test.o -o test_http_client -lpthread -lgnutls -lnettle -lhogweed -lgmp user@instant-contiki:~/Desktop/FreeCoAP-master/FreeCoAP-master/test/test_http_client$ ./test_http_client Error : unable to load TLS credentials

keith-cullen commented 7 years ago

test_http_client tries to open the following files:

define TRUST_FILE_NAME "../../certs/root_server_cert.pem" /*< TLS trust file name /

define CERT_FILE_NAME "../../certs/clientcert.pem" /**< TLS certificate file name /

define KEY_FILE_NAME "../../certs/clientprivkey.pem" /< TLS key file name /

The error indicates that test_http_client cannot find these files at the paths specified or that the date on your target machine is outside the valid range on the certificates.

You need to make sure that these certificates are present on your target machine and that the paths above point to them. The certificates are valid from July 8th 2016 to July 8th 2026. Check that the date on your target machine is within this range.