mmaceachran
mmaceachran

Reputation: 3338

Statically Link OpenSSL in my c program

I am trying to use mod_auth_cas in my Oracle 12 HTTP Server. However, Oracle, in its infinite wizdumb, has removed mod_ssl and gone with it's own ossl. So now my mod_auth_cas does not work as it is linked with openSSL. (I a getting an "undefined symbol SSL_connect" error)

Looking at the code (https://github.com/Jasig/mod_auth_cas/tree/master/src) I see this:

#include <openssl/crypto.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
#include <openssl/ssl.h>
#include <openssl/err.h>

I know I can statically link this through the gcc compiler, however it uses a Makefile and I am in no way (im a Java guy) I have the ability to do this in a makefile.

So my questions are:

  1. Can I force the compiler to statically link openssl from the code itself so I don;t have to mess with the makefile (Like is there a #includestatic directive)

OR

  1. Do I need the makefile? can I just create a one line gcc that will compile what I need (It's only 2 .c files and 2 .h files)

OR

  1. Can I compile this against the mod_ossl that oracle uses? How would I go about doing that as I have no idea what im doing here. :)

Thanks for any tips!

Upvotes: 0

Views: 284

Answers (1)

Some programmer dude
Some programmer dude

Reputation: 409136

  1. No, you need to modify the makefile.
  2. Yes, you can do it all with a single command.
  3. Probably not.

Upvotes: 1

Related Questions