docker build -t openssl_dtls:stretch -f Dockerfile.stretch .
docker run --rm openssl_dtls:stretch
docker build -t openssl_dtls:buster -f Dockerfile.buster .
docker run --rm openssl_dtls:buster
FROM debian:buster | |
RUN apt-get update && apt-get install -y openssl libssl-dev gcc | |
COPY example.c /example.c | |
RUN gcc -I/usr/include/openssl -lssl -lcrypto -o example example.c | |
CMD ["/example"] |
FROM debian:stretch | |
RUN apt-get update && apt-get install -y openssl libssl-dev gcc | |
COPY example.c /example.c | |
RUN gcc -I/usr/include/openssl -lssl -lcrypto -o example example.c | |
CMD ["/example"] |
#include <stdio.h> | |
#include <openssl/ssl.h> | |
int main(int argc, char* argv) { | |
SSL_CTX *context = SSL_CTX_new(DTLS_method()); | |
unsigned long error_code = ERR_peek_error(); | |
if (error_code) { | |
char buf[512]; | |
ERR_error_string_n(error_code, &buf, 512); | |
printf("Error create in SSL context: %s\n", buf); | |
return 1; | |
} else if (!context) { | |
printf("No error but the context is empty\n"); | |
return 1; | |
} else { | |
printf("OK\n"); | |
return 0; | |
} | |
} |
This indeed works and removes openssl system version without uninstalling node and lots of other packages:
And it indeed fixes the test above! Yay! Thanks!