# Nginx build with OpenSSL 1.0.1

**URL:** <https://www.ruby-forum.com/t/nginx-build-with-openssl-1-0-1/217854>\
**Category:** NGINX\
**Created:** [March 14, 2012, 8:36pm UTC](https://www.ruby-forum.com/t/nginx-build-with-openssl-1-0-1/217854 "2012-03-14T20:36:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [March 14, 2012, 8:36pm UTC](https://www.ruby-forum.com/t/nginx-build-with-openssl-1-0-1/217854/1 "2012-03-14T20:36:00Z")

</div>

Hello, community,

I’m having trouble compiling nginx against OpenSSL 1.0.1. When I compile  
OpenSSL manually, I have no problems, everything is fine, but when  
trying to compile nginx with the --with-openssl option the compilation  
fails with the following message:

…  
make[4]: Leaving directory  
`/usr/src/redhat/SOURCES/openssl-1.0.1/crypto/cmac' if [-n ""]; then \ (cd ..; make libcrypto.so.1.0.0); \ fi make[3]: Leaving directory `/usr/src/redhat/SOURCES/openssl-1.0.1/crypto’  
make[2]: Leaving directory `/usr/src/redhat/SOURCES/openssl-1.0.1’  
make[1]: \*\*\*  
[/usr/src/redhat/SOURCES/openssl-1.0.1/.openssl/include/openssl/ssl.h]  
Error 2

When I try to do a “make all” from openssl-1.0.1/crypto without cleaning  
the source tree, it fails with:

…  
cc -I. -I… -I…/include -g -c -o mem\_clr.o mem\_clr.c  
ar r …/libcrypto.a cryptlib.o mem.o mem\_dbg.o cversion.o ex\_data.o  
cpt\_err.o ebcdic.o uid.o o\_time.o o\_str.o o\_dir.o o\_fips.o o\_init.o  
fips\_ers.o mem\_clr.o  
[-z “”] || ar r …/libcrypto.a fipscanister.o  
…/libcrypto.a || echo Never mind.  
/bin/sh: …/libcrypto.a: Permission denied  
Never mind.  
make: \*\*\* [subdirs] Error 1

Does anyone have an idea how to properly address this?

Posted at Nginx Forum:

> **[nginx build with OpenSSL 1.0.1](https://forum.nginx.org/read.php?2,223843,223843#msg-223843)**
>
> Hello, community, I'm having trouble compiling nginx against OpenSSL 1.0.1. When I compile OpenSSL manually, I have no problems, everything is fine, but when trying to compile nginx with the --with-openssl option the compilation fails with the...

---

<div class="post-metadata">

**Author:** ![Samael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b5ac83/32.png) [@Samael](https://www.ruby-forum.com/u/Samael)\
**Post date:** [March 15, 2012, 1:42am UTC](https://www.ruby-forum.com/t/nginx-build-with-openssl-1-0-1/217854/2 "2012-03-15T01:42:05Z")

</div>

Hello!

On Wed, Mar 14, 2012 at 03:35:09PM -0400, Samael wrote:

> if [-n “”]; then   
> (cd ..; make libcrypto.so.1.0.0);   
> fi  
> make[3]: Leaving directory  
> `/usr/src/redhat/SOURCES/openssl-1.0.1/crypto' make[2]: Leaving directory `/usr/src/redhat/SOURCES/openssl-1.0.1’  
> make[1]: \*\*\*  
> [/usr/src/redhat/SOURCES/openssl-1.0.1/.openssl/include/openssl/ssl.h]  
> Error 2

Is it vanilla OpenSSL or some redhat-patched sources? Vanilla one  
builds just fine here under FreeBSD as well as CentOS 6.2.

If it indeed doesn’t work for you with vanilla OpenSSL, please try  
to remove and re-extract sources from openssl-1.0.1.tar.gz tarball  
to make sure there are no accedental changes.

If it still fails to build with nginx, please provide full  
transcript of the nginx ./configure and build till failure, as  
well as some more details information about your OS.

You may also try doing relevant build commands in openssl build  
directory yourself, in particular make sure the following works ok  
in the directory with openssl sources:

./config no-shared no-threads && make

If it fails, there is probably some issue completely unrelated to  
nginx.

> /bin/sh: ../libcrypto.a: Permission denied  
> Never mind.  
> make: \*\*\* [subdirs] Error 1

This is expected to fail, you have to run just “make” (or “make  
top”, which is the same). The “all” target requires variables set  
by top-level makefile.

Maxim D.

---

<div class="post-metadata">

**Author:** ![Samael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b5ac83/32.png) [@Samael](https://www.ruby-forum.com/u/Samael)\
**Post date:** [March 15, 2012, 10:13am UTC](https://www.ruby-forum.com/t/nginx-build-with-openssl-1-0-1/217854/3 "2012-03-15T10:13:51Z")

</div>

Hello, Maxim,

I’m compiling with vanilla nginx 1.1.16 with vanilla OpenSSL sources on  
CentOS 5 i686. When I compile OpenSSL manually, it compiles (and works)  
just fine.

> <https://gist.github.com/anonymous/1c7d728ac08f3c314eea>

Thanks for the “make all” clarification.

Posted at Nginx Forum:

> **[Re: nginx build with OpenSSL 1.0.1](https://forum.nginx.org/read.php?2,223843,223869#msg-223869)**
>
> Hello, community, I'm having trouble compiling nginx against OpenSSL 1.0.1. When I compile OpenSSL manually, I have no problems, everything is fine, but when trying to compile nginx with the --with-openssl option the compilation fails with the...

---

<div class="post-metadata">

**Author:** ![Samael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b5ac83/32.png) [@Samael](https://www.ruby-forum.com/u/Samael)\
**Post date:** [March 15, 2012, 10:56am UTC](https://www.ruby-forum.com/t/nginx-build-with-openssl-1-0-1/217854/4 "2012-03-15T10:56:12Z")

</div>

Hello!

On Thu, Mar 15, 2012 at 05:13:30AM -0400, Samael wrote:

> Hello, Maxim,
> 
> I’m compiling with vanilla nginx 1.1.16 with vanilla OpenSSL sources on  
> CentOS 5 i686. When I compile OpenSSL manually, it compiles (and works)  
> just fine.
> 
> [Compile nginx 1.1.16 with OpenSSL 1.0.1 · GitHub](https://gist.github.com/1c7d728ac08f3c314eea)

The “make -j2” you use seems to be the culprit, OpenSSL fails to  
build with the “make -j2”. The following fails for me as well:

./config no-shared no-threads  
make -j2

You may want to report this problem to OpenSSL folks.

Meanwile, workaround is obvious - don’t use “make -j2” till this  
is fixed in OpenSSL.

Maxim D.

---

<div class="post-metadata">

**Author:** ![Samael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b5ac83/32.png) [@Samael](https://www.ruby-forum.com/u/Samael)\
**Post date:** [March 15, 2012, 11:14am UTC](https://www.ruby-forum.com/t/nginx-build-with-openssl-1-0-1/217854/5 "2012-03-15T11:14:52Z")

</div>

Oh, boy, was this stupid. Thank you very much, I’ve actually though  
about this, but said “naah, probably won’t help”.

I will report it to the OpenSSL guys.

Posted at Nginx Forum:

> **[Re: nginx build with OpenSSL 1.0.1](https://forum.nginx.org/read.php?2,223843,223873#msg-223873)**
>
> Hello, community, I'm having trouble compiling nginx against OpenSSL 1.0.1. When I compile OpenSSL manually, I have no problems, everything is fine, but when trying to compile nginx with the --with-openssl option the compilation fails with the...
