# Self-signed certificate for Http requests doesn't work

**URL:** <https://forums.unrealengine.com/t/self-signed-certificate-for-http-requests-doesnt-work/1784273>\
**Category:** Programming & Scripting\
**Tags:** httprequest, unreal-engine, CPP, question\
**Created:** [April 2, 2024, 8:18pm UTC](https://forums.unrealengine.com/t/self-signed-certificate-for-http-requests-doesnt-work/1784273 "2024-04-02T20:18:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Human3\_0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Human3\_0](https://forums.unrealengine.com/u/Human3_0)\
**Post date:** [April 2, 2024, 8:18pm UTC](https://forums.unrealengine.com/t/self-signed-certificate-for-http-requests-doesnt-work/1784273/1 "2024-04-02T20:18:11Z")

</div>

Good day everyone.  
We are stuck at probably very banal point.

We have a server with self-signed certificate. We are doing requests to this server via FHttpModule.

Via browser and via command line curl I can do it. But not with my code requests we got error:

LogInit: Using libcurl 7.83.1  
LogInit: CURL\_VERSION\_SSL  
LogInit: CURL\_VERSION\_LIBZ  
LogInit: CURL\_VERSION\_IPV6  
LogInit: CURL\_VERSION\_ASYNCHDNS  
LogInit: CURL\_VERSION\_LARGEFILE  
LogInit: CurlRequestOptions (configurable via config and command line):  
LogInit: - bVerifyPeer = false - Libcurl will NOT verify peer certificate  
LogInit: - bUseHttpProxy = false - Libcurl will NOT use HTTP proxy  
LogInit: - bDontReuseConnections = false - Libcurl will reuse connections  
LogInit: - MaxHostConnections = 16 - Libcurl will limit the number of connections to a host  
…  
libcurl error: 60 (SSL peer certificate or SSH remote key was not OK)  
…  
libcurl info message cache 14 (Server certificate:)  
libcurl info message cache 15 ( subject: C=CA; ST=None; L=NB; O=None; CN=MY\_IP)  
libcurl info message cache 16 ( start date: Apr 1 20:49:38 2024 GMT)  
libcurl info message cache 17 ( expire date: Apr 1 20:49:38 2027 GMT)  
libcurl info message cache 18 ( subjectAltName does not match MY\_IP)  
libcurl info message cache 19 (SSL: no alternative certificate subject name matches target host name ‘MY\_IP’)  
libcurl info message cache 20 (Closing connection 1)

* * *

We generate certificate as  
openssl x509 -req -in device.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out device.crt -days $NUM\_OF\_DAYS -sha256 -extfile /tmp/\_\_v3.ext

* * *

v3.ext:  
authorityKeyIdentifier=keyid,issuer  
basicConstraints=CA:FALSE  
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment  
subjectAltName = @alt\_names

## [alt\_names] DNS.1 = %%DOMAIN%% DNS.2 = \*.%%DOMAIN%%

So in browser I see  
Certificate Subject Alternative Name:  
Not Critical  
DNS Name: MY\_IP  
DNS Name: \*.MY\_IP  
IP Address: MY\_IP

* * *

The questions is “What is wrong with subjectAltName” and “is it okey for Unreal use Self-Signed Certificates”?

We also put our Certificate to Engine\Content\Certificates\ThirdParty\cacert.pem. Is it the only place we could put it?

---

<div class="post-metadata">

**Author:** ![Human3\_0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Human3\_0](https://forums.unrealengine.com/u/Human3_0)\
**Post date:** [April 6, 2024, 7:02pm UTC](https://forums.unrealengine.com/t/self-signed-certificate-for-http-requests-doesnt-work/1784273/2 "2024-04-06T19:02:04Z")

</div>

The problem was in putting IP\_ADDRESS inside DNS here  
[alt\_names]  
DNS.1 = %%DOMAIN%%  
DNS.2 = \*.%%DOMAIN%%

But is have to be  
[alt\_names]  
IP = %%MY\_IP%%

Doc explains acceptable format:  
[https://www.openssl.org/docs/manmaster/man5/x509v3\_config.html](https://www.openssl.org/docs/manmaster/man5/x509v3_config.html)

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [May 6, 2024, 7:02pm UTC](https://forums.unrealengine.com/t/self-signed-certificate-for-http-requests-doesnt-work/1784273/3 "2024-05-06T19:02:10Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
