# Can't build with USE\_OPENSSL

**URL:** <https://discourse.haproxy.org/t/cant-build-with-use-openssl/1122>\
**Category:** Help!\
**Created:** [March 27, 2017, 8:27am UTC](https://discourse.haproxy.org/t/cant-build-with-use-openssl/1122 "2017-03-27T08:27:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ItsIllak](https://avatars.discourse-cdn.com/v4/letter/i/8c91f0/32.png) [@ItsIllak](https://discourse.haproxy.org/u/ItsIllak)\
**Post date:** [March 27, 2017, 8:27am UTC](https://discourse.haproxy.org/t/cant-build-with-use-openssl/1122/1 "2017-03-27T08:27:03Z")

</div>

Very new to HAProxy (moving over from a simple rewrite/proxy based Apache. I’m setting it up in a pretty restricted environment (e.g. I don’t have package access and more). I need it to support SSL so I’ve been building with the following:

System is RHEL6.7

make TARGET=linux2628 USE\_OPENSSL=1 USE\_ZLIB=1

But I end up with the error:

gcc -g -o haproxy src/haproxy.o src/base64.o src/protocol.o src/uri\_auth.o src/standard.o src/buffer.o src/log.o src/task.o src/chunk.o src/channel.o src/listener.o src/lru.o src/xxhash.o src/time.o src/fd.o src/pipe.o src/regex.o src/cfgparse.o src/server.o src/checks.o src/queue.o src/frontend.o src/proxy.o src/peers.o src/arg.o src/stick\_table.o src/proto\_uxst.o src/connection.o src/proto\_http.o src/raw\_sock.o src/backend.o src/tcp\_rules.o src/lb\_chash.o src/lb\_fwlc.o src/lb\_fwrr.o src/lb\_map.o src/lb\_fas.o src/stream\_interface.o src/stats.o src/proto\_tcp.o src/applet.o src/session.o src/stream.o src/hdr\_idx.o src/ev\_select.o src/signal.o src/acl.o src/sample.o src/memory.o src/freq\_ctr.o src/auth.o src/proto\_udp.o src/compression.o src/payload.o src/hash.o src/pattern.o src/map.o src/namespace.o src/mailers.o src/dns.o src/vars.o src/filters.o src/flt\_http\_comp.o src/flt\_trace.o src/flt\_spoe.o src/cli.o src/ev\_poll.o src/ev\_epoll.o src/ssl\_sock.o src/shctx.o ebtree/ebtree.o ebtree/eb32tree.o ebtree/eb64tree.o ebtree/ebmbtree.o ebtree/ebsttree.o ebtree/ebimtree.o ebtree/ebistree.o -lcrypt -lz -ldl -lssl -lcrypto -ldl  
src/ssl\_sock.o: In function `smp_fetch_ssl_fc_alpn': /happrd/haproxy1.7.3/src/ssl_sock.c:4925: undefined reference to`SSL\_get0\_alpn\_selected’  
src/ssl\_sock.o: In function `ssl_sock_prepare_ctx': /happrd/haproxy1.7.3/src/ssl_sock.c:2877: undefined reference to`SSL\_CTX\_set\_alpn\_select\_cb’  
src/ssl\_sock.o: In function `ssl_sock_load_sctl': /happrd/haproxy1.7.3/src/ssl_sock.c:1004: undefined reference to`SSL\_CTX\_add\_server\_custom\_ext’  
collect2: ld returned 1 exit status  
make: \*\*\* [haproxy] Error 1

I’m guessing the OpenSSL Devel version? But I got the latest package available for 6.7 installed by the server maintainers…

Any clue?

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [March 27, 2017, 8:47am UTC](https://discourse.haproxy.org/t/cant-build-with-use-openssl/1122/2 "2017-03-27T08:47:31Z")

</div>

Looks like TLSEXT\_TYPE\_application\_layer\_protocol\_negotiation is defined, but actual ALPN support is missing.

Please confirm OpenSSL and it’s devel package is exclusively installed from stock RHEL repositories, no backports or third party RPM?

If that is the case, remove all of those RPM and install RHEL stock RPM’s please.

Also provide the output of:

> yum info openssl  
> yum info openssl-devel

---

<div class="post-metadata">

**Author:** ![ItsIllak](https://avatars.discourse-cdn.com/v4/letter/i/8c91f0/32.png) [@ItsIllak](https://discourse.haproxy.org/u/ItsIllak)\
**Post date:** [March 27, 2017, 10:08am UTC](https://discourse.haproxy.org/t/cant-build-with-use-openssl/1122/3 "2017-03-27T10:08:59Z")

</div>

# yum info openssl

Loaded plugins: security  
Installed Packages  
Name : openssl  
Arch : x86\_64  
Version : 1.0.1e  
Release : 48.el6\_8.4  
Size : 4.0 M  
Repo : installed  
From repo : xxx (our own)  
Summary : A general purpose cryptography library with TLS implementation  
URL : [http://www.openssl.org/](http://www.openssl.org/)  
License : OpenSSL  
Description : The OpenSSL toolkit provides support for secure communications  
: between machines. OpenSSL includes a certificate management tool  
: and shared libraries which provide various cryptographic  
: algorithms and protocols.

# yum info openssl-devel

Loaded plugins: security  
Installed Packages  
Name : openssl-devel  
Arch : x86\_64  
Version : 1.0.1e  
Release : 48.el6\_8.4  
Size : 2.2 M  
Repo : installed  
From repo : xxx (our own)  
Summary : Files for development of applications which will use OpenSSL  
URL : [http://www.openssl.org/](http://www.openssl.org/)  
License : OpenSSL  
Description : OpenSSL is a toolkit for supporting cryptography. The  
: openssl-devel package contains include files needed to develop  
: applications which support various cryptographic algorithms and  
: protocols.

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [March 27, 2017, 10:28am UTC](https://discourse.haproxy.org/t/cant-build-with-use-openssl/1122/4 "2017-03-27T10:28:37Z")

</div>

I don’t know what to tell you, something is wrong with either your repository, or box. Probably someone attempted to upgrade openssl to a newer version on your machine, and now you have multiple parallel openssl version floating around.

Fact is, haproxy 1.7.3 builds just fine on Centos 6.7, I just tried with the LiveCD.

Try installing the OS from scratch if you are unable to fix it.

---

<div class="post-metadata">

**Author:** ![anon88575059](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@anon88575059](https://discourse.haproxy.org/u/anon88575059)\
**Post date:** [April 21, 2017, 4:03pm UTC](https://discourse.haproxy.org/t/cant-build-with-use-openssl/1122/5 "2017-04-21T16:03:59Z")

</div>

If you are looking for HAProxy on CentOS you can have a look at our repository:  
[https://www.ulyaoth.net/repository/haproxy.html](https://www.ulyaoth.net/repository/haproxy.html)

that are precreated rpm packages that you can install on CentOS, saves you compiling it yourself they are compiled with the latest OpenSSL and updated regularly.
