Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using OpenSSL #2

Open
simotronic opened this issue Mar 19, 2015 · 7 comments
Open

Using OpenSSL #2

simotronic opened this issue Mar 19, 2015 · 7 comments

Comments

@simotronic
Copy link

I'm pretty new to the API / REST / C++ field so please bear with me.
I've managed to utilize the PHP API from my web server application. However, I wish to extend the capability of my system. I have a daemon running in C on my server that polls 500+ pieces of equipment out in the world. I am migrating to twilio to utilize their servicse to handle messaging as opposed to 'in house' sendmail techniques. So I wanted to embark upon using your C++ API functions. But we removed OpenSSL due to heartbleed vulnerabilities so the library is not there. Are there any workarounds/
Thanks

@simotronic
Copy link
Author

I have found I am running into some SSL library issues. not being a guru when it comes to compiling against libraries I suspect I have references to library that is not wuite there. I have openssl 1.0.1f under Ubuntu 14.02 LTS and I get:
/usr/bin/ld: Utils.o: undefined reference to symbol 'BIO_ctrl@@OPENSSL_1.0.0'
//lib/x86_64-linux-gnu/libcrypto.so.1.0.0: error adding symbols: DSO missing from command line

I can compile under Debian with libssl0.9 -
Any suggestions where I start?
Thanks

@pcolby
Copy link
Contributor

pcolby commented Mar 23, 2015

Try adding -lssl such as:

diff --git a/Makefile b/Makefile
index 1fcb9d9..e9c6e8e 100644
--- a/Makefile
+++ b/Makefile
@@ -22,7 +22,7 @@ unittests: runner
        ./runner

 runner: runner.cpp
-       g++ -Wall -I./ -o $@ Rest.o TwiML.o Utils.o -lcurl $^
+       g++ -Wall -I./ -o $@ Rest.o TwiML.o Utils.o -lcurl -lssl $^

 runner.cpp: UnitTests.h
        ./cxxtestgen.py -o $@ --error-printer $^

Cheers.

@simotronic
Copy link
Author

Thanks!
I tried adding those directives. I think my error is in my libcrypto -
my openssl:
Installed: 1.0.1f-1ubuntu2.11
when I compile I get:
/usr/bin/ld: Utils.o: undefined reference to symbol 'BIO_ctrl@@OPENSSL_1.0.0'
//lib/x86_64-linux-gnu/libcrypto.so.1.0.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Trying to determine if libcrypto is installed!
I suspect something doesn't match somewhere...

@pcolby
Copy link
Contributor

pcolby commented Mar 23, 2015

For that, try adding -lcrypto

Cheers.

@simotronic
Copy link
Author

Ahhh - a little progress I added -lcrpto to the Makefile

@simotronic
Copy link
Author

So Now I can successfully send messages...(!)
Since I'm finding my way around the API I was wondering how to extract information from the twiML response, specifically the SMS message id (Sid?) and any error code - I plan on logging that in a table elsewhere together with the identification of the message i sent for auditing purposes. Later i plan on using the ability of twilio to send a response to the server that can be further added to my table, confirming that the recipient acknowledged the message!

@dendisuhubdy
Copy link

export OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include

see this here sfackler/rust-openssl#255 similar probs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants