# Compiling with a custom SSL library

**URL:** <https://www.ruby-forum.com/t/compiling-with-a-custom-ssl-library/207006>\
**Category:** NGINX\
**Created:** [May 16, 2011, 6:02am UTC](https://www.ruby-forum.com/t/compiling-with-a-custom-ssl-library/207006 "2011-05-16T06:02:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [May 16, 2011, 6:02am UTC](https://www.ruby-forum.com/t/compiling-with-a-custom-ssl-library/207006/1 "2011-05-16T06:02:09Z")

</div>

Decided to compile my own copy of openssl (dev snapshot) which is  
stored in /usr/local/ssl ,…but nginx isn’t detecting it ☹

root@server:/usr/local/ssl# ls -al  
total 48  
drwxr-xr-x 9 root root 4096 2011-05-15 22:15 .  
drwxr-xr-x 13 root root 4096 2011-05-15 22:13 …  
drwxr-xr-x 2 root root 4096 2011-05-15 22:15 bin  
drwxr-xr-x 2 root root 4096 2011-05-15 22:15 certs  
drwxr-xr-x 3 root root 4096 2011-05-15 22:15 include  
drwxr-xr-x 4 root root 4096 2011-05-15 22:15 lib  
drwxr-xr-x 6 root root 4096 2011-05-15 22:13 man  
drwxr-xr-x 2 root root 4096 2011-05-15 22:15 misc  
-rw-r–r-- 1 root root 10819 2011-05-15 22:15 openssl.cnf  
drwxr-xr-x 2 root root 4096 2011-05-15 22:15 private

Tried combinations of --with-openssl=/usr/local/ssl and /usr/local

root@server:~/nginx-1.0.2# make  
make -f objs/Makefile  
make[1]: Entering directory `/root/nginx-1.0.2' cd /usr/local/ssl \ && make clean \ && ./config --prefix=/usr/local/ssl/.openssl no-shared no-threads \ && make \ && make install LIBDIR=lib make[2]: Entering directory`/usr/local/ssl’  
make[2]: \*\*\* No rule to make target `clean'. Stop. make[2]: Leaving directory`/usr/local/ssl’  
make[1]: \*\*\* [/usr/local/ssl/.openssl/include/openssl/ssl.h] Error 2  
make[1]: Leaving directory `/root/nginx-1.0.2’  
make: \*\*\* [build] Error 2

What is the correct ssl dir I need to point it to?

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 16, 2011, 6:43am UTC](https://www.ruby-forum.com/t/compiling-with-a-custom-ssl-library/207006/2 "2011-05-16T06:43:27Z")

</div>

Okay, managed to “fix” it, by modifying auto/lib/openssl/conf

from

```
        CORE_INCS="$CORE_INCS $OPENSSL/.openssl/include"
        CORE_DEPS="$CORE_DEPS 

```

$OPENSSL/.openssl/include/openssl/ssl.h"  
CORE\_LIBS="$CORE\_LIBS $OPENSSL/.openssl/lib/libssl.a"  
CORE\_LIBS="$CORE\_LIBS $OPENSSL/.openssl/lib/libcrypto.a"

to,

```
        CORE_INCS="$CORE_INCS $OPENSSL/openssl/include"
        CORE_DEPS="$CORE_DEPS 

```

$OPENSSL/openssl/include/openssl/ssl.h"  
CORE\_LIBS="$CORE\_LIBS $OPENSSL/openssl/lib/libssl.a"  
CORE\_LIBS="$CORE\_LIBS $OPENSSL/openssl/lib/libcrypto.a"

and link /usr/local/openssl -\> /usr/local/ssl

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 16, 2011, 7:07am UTC](https://www.ruby-forum.com/t/compiling-with-a-custom-ssl-library/207006/3 "2011-05-16T07:07:30Z")

</div>

On Mon, May 16, 2011 at 04:01:34PM +1200, Ryan B wrote:

> drwxr-xr-x 4 root root 4096 2011-05-15 22:15 lib  
> cd /usr/local/ssl \
> 
> What is the correct ssl dir I need to point it to?

./configure --help | grep openssl=  
–with-openssl=DIR set path to OpenSSL library sources

The sources, but not pre-built installation.

wget [http://openssl.org/source/openssl-1.0.0d.tar.gz](http://openssl.org/source/openssl-1.0.0d.tar.gz)  
tar zxf openssl-1.0.0d.tar.gz  
cd nginx-1.0.2  
./configure --with-openssl=../openssl-1.0.0d …

–  
Igor S.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 17, 2011, 2:02am UTC](https://www.ruby-forum.com/t/compiling-with-a-custom-ssl-library/207006/4 "2011-05-17T02:02:10Z")

</div>

thanks Igor that helped me with my custom nginx 1.0.2 + php-fpm openssl  
1.0.0d install as well 🙂

Posted at Nginx Forum:

> **[Re: Compiling with a custom SSL library](https://forum.nginx.org/read.php?2,198369,198600#msg-198600)**
>
> Decided to compile my own copy of openssl (dev snapshot) which is stored in /usr/local/ssl ,...but nginx isn't detecting it :( root@server:/usr/local/ssl# ls -al total 48 drwxr-xr-x 9 root root 4096 2011-05-15 22:15 . drwxr-xr-x 13 root root 4096...
