Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

The best way to accelerate a Macintoy is at 9.8 meters per second per second.


devel / comp.unix.programmer / Re: sslserver

SubjectAuthor
* sslserverJohanne Fairchild
`* Re: sslservervallor
 +- Re: sslserverLawrence D'Oliveiro
 `* Re: sslserverJohanne Fairchild
  +- Re: sslserverScott Lurndal
  +- Re: sslserverRichard Kettlewell
  `* Re: sslservervallor
   `- Re: sslservervallor

1
sslserver

<87msqndb7y.fsf@tudado.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11512&group=comp.unix.programmer#11512

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jfairch...@tudado.org (Johanne Fairchild)
Newsgroups: comp.unix.programmer
Subject: sslserver
Date: Sun, 24 Mar 2024 10:13:21 -0300
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <87msqndb7y.fsf@tudado.org>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="4a41f8feac8c6336db4b611990346be3";
logging-data="409595"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+QSp1OTKILAvWfmPwHWXYkW86Dp0x14+Y="
Cancel-Lock: sha1:huytYTgVEjbwTadY+6AQ9ux3Ka8=
sha1:vcakh4aerqARYF5MtnSHLKzyXHs=
 by: Johanne Fairchild - Sun, 24 Mar 2024 13:13 UTC

I'm running a brand new FreeBSD 13.2-RELEASE-p10. I installed the
pkg-package ucspi-ssl-0.99b_1. I never used it, so I don't know what to
expect. Can you explain what I should do about this error?

%sslserver 0 1031 cat
sslserver: fatal: unable to set DH parameters

Instead of 0 (as in bind all interfaces) I also tried an IP address, a
hostname such as ``localhost'' et cetera. Unable to set DH parameters
sounds like cryptography bureaucracy. The DH might stand for
diffie-hellman. Perhaps the software doesn't know how to locate some
configuration it needs? The website of the program is at

https://www.fehcom.de/ipnet/ucspi-ssl.html

but it doesn't seem to have documentation for a newcomer.

Re: sslserver

<utsrgt$14tqr$3@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11513&group=comp.unix.programmer#11513

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: val...@cultnix.org (vallor)
Newsgroups: comp.unix.programmer
Subject: Re: sslserver
Date: Mon, 25 Mar 2024 21:49:17 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <utsrgt$14tqr$3@dont-email.me>
References: <87msqndb7y.fsf@tudado.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 25 Mar 2024 22:49:18 +0100 (CET)
Injection-Info: dont-email.me; posting-host="04c35eae62bd772e84d3e431f3ad019d";
logging-data="1210203"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19aLoKvjAE/f3M9/VH9u1TK"
User-Agent: Pan/0.155 (Kherson; 7c7f9dc gitlab.gnome.org/GNOME/pan.git;
x86_64-pc-linux-gnu)
Cancel-Lock: sha1:2ZJ3R5eS/4NcvCwLZJWt6UqGLyg=
X-Face: \}2`P"_@pS86<'EM:'b.Ml}8IuMK"pV"?FReF$'c.S%u9<Q#U*4QO)$l81M`{Q/n
XL'`91kd%N::LG:=*\35JS0prp\VJN^<s"b#bff@fA7]5lJA.jn,x_d%Md$,{.EZ
 by: vallor - Mon, 25 Mar 2024 21:49 UTC

On Sun, 24 Mar 2024 10:13:21 -0300, Johanne Fairchild
<jfairchild@tudado.org> wrote in <87msqndb7y.fsf@tudado.org>:

> I'm running a brand new FreeBSD 13.2-RELEASE-p10. I installed the
> pkg-package ucspi-ssl-0.99b_1. I never used it, so I don't know what to
> expect. Can you explain what I should do about this error?
>
> %sslserver 0 1031 cat
> sslserver: fatal: unable to set DH parameters
>
> Instead of 0 (as in bind all interfaces) I also tried an IP address, a
> hostname such as ``localhost'' et cetera. Unable to set DH parameters
> sounds like cryptography bureaucracy. The DH might stand for
> diffie-hellman. Perhaps the software doesn't know how to locate some
> configuration it needs? The website of the program is at
>
> https://www.fehcom.de/ipnet/ucspi-ssl.html
>
> but it doesn't seem to have documentation for a newcomer.

A quick look around shows it's a hard-to-find tool.

Looks like step 8 in this document, which might help:

https://github.com/meixler/installing-configuring-and-running-ucspi-ssl-sslserver

(It's not in any of the Linux repositories I use.)

Hope that helps.

--
-v

Re: sslserver

<utt4im$1d406$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11514&group=comp.unix.programmer#11514

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.programmer
Subject: Re: sslserver
Date: Tue, 26 Mar 2024 00:23:51 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <utt4im$1d406$1@dont-email.me>
References: <87msqndb7y.fsf@tudado.org> <utsrgt$14tqr$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 26 Mar 2024 01:23:51 +0100 (CET)
Injection-Info: dont-email.me; posting-host="004a195aa1301a8fff573477f7fa62f0";
logging-data="1478662"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19E8mckyu4z9xmOkP7Dbcsm"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:K1y60xQikAzCoEjcefW5R1MYoWY=
 by: Lawrence D'Oliv - Tue, 26 Mar 2024 00:23 UTC

On Mon, 25 Mar 2024 21:49:17 -0000 (UTC), vallor wrote:

> https://github.com/meixler/installing-configuring-and-running-ucspi-ssl-sslserver

The details there mention the use of Let’s Encrypt for generating the
cert. That’s fine for a public-access server, not so good if you just
want to experiment privately.

For private use, you want to create your own internal CA cert, and use
that to sign your own internal certs. Luckily, the OpenSSL 3.x tools
make this fairly easy to do. I have instructions here
<https://gitlab.com/ldo/ssl_try_python/>.

Re: sslserver

<87il172voe.fsf@tudado.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11515&group=comp.unix.programmer#11515

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jfairch...@tudado.org (Johanne Fairchild)
Newsgroups: comp.unix.programmer
Subject: Re: sslserver
Date: Wed, 27 Mar 2024 18:48:17 -0300
Organization: A noiseless patient Spider
Lines: 127
Message-ID: <87il172voe.fsf@tudado.org>
References: <87msqndb7y.fsf@tudado.org> <utsrgt$14tqr$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Wed, 27 Mar 2024 21:48:22 +0100 (CET)
Injection-Info: dont-email.me; posting-host="d133e4a7e1905880f21aeec32ea5dda2";
logging-data="3254475"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Fmg8Nb7a3pX+TjIndT8W2UEE8YknM/hw="
Cancel-Lock: sha1:5celbuiB+X/kJO66qiRbQQCI2yk=
sha1:HRrkU5T0BKuGExxVKX9F6PSiIaI=
 by: Johanne Fairchild - Wed, 27 Mar 2024 21:48 UTC

vallor <vallor@cultnix.org> writes:

> On Sun, 24 Mar 2024 10:13:21 -0300, Johanne Fairchild
> <jfairchild@tudado.org> wrote in <87msqndb7y.fsf@tudado.org>:
>
>> I'm running a brand new FreeBSD 13.2-RELEASE-p10. I installed the
>> pkg-package ucspi-ssl-0.99b_1. I never used it, so I don't know what to
>> expect. Can you explain what I should do about this error?
>>
>> %sslserver 0 1031 cat
>> sslserver: fatal: unable to set DH parameters
>>
>> Instead of 0 (as in bind all interfaces) I also tried an IP address, a
>> hostname such as ``localhost'' et cetera. Unable to set DH parameters
>> sounds like cryptography bureaucracy. The DH might stand for
>> diffie-hellman. Perhaps the software doesn't know how to locate some
>> configuration it needs? The website of the program is at
>>
>> https://www.fehcom.de/ipnet/ucspi-ssl.html
>>
>> but it doesn't seem to have documentation for a newcomer.
>
> A quick look around shows it's a hard-to-find tool.

Indeed. I wonder why. Such a useful tool.

> Looks like step 8 in this document, which might help:
>
> https://github.com/meixler/installing-configuring-and-running-ucspi-ssl-sslserver

This is wonderful.

--8<---------------cut here---------------start------------->8---
It took me a fair amount of time (and Googling, and trial-and-error,
and even some help from Erwin Hoffman) to get ucspi-ssl sslserver up
and running, as there are a number of nuances in the process. So, I
thought I would document the steps that worked for me to get ucspi-ssl
sslserver up and running to have as a reference for myself, as well as
for others that may find this useful.
--8<---------------cut here---------------end--------------->8---

I'm still missing at least one step. I followed the guide above, but
sslserver still misses a key.

# CERTFILE="/etc/ssl/cert.pem" DHFILE="/etc/ssl/dh2048.pem" \
sslserver -sH1 0.0.0.0 1234 cat
1234
sslserver: fatal: unable to load key

The documentation mentions the KEYFILE environment variable, so I
thought that could be it. I said

# CERTFILE="/etc/ssl/nntp-cert.pem" \
DHFILE="/etc/ssl/dh2048.pem" \
KEYFILE=/etc/ssl/nntp-key.pem sslserver -sH1 0.0.0.0 1234 cat
1234
sslserver: fatal: unable to load key

Same thing. Looking at the source code, the failure happens here in
main():

if (certchainfile) {
switch (ssl_chainfile(ctx,certchainfile,keyfile,passwd_cb)) {
case -1: strerr_die2x(111,FATAL,"unable to load certificate chain file");
case -2: strerr_die2x(111,FATAL,"unable to load key");
case -3: strerr_die2x(111,FATAL,"key does not match certificate");
default: break;
}
}

Looking at ssl_chainfile(), we find:

int ssl_chainfile(SSL_CTX *ctx,const char *certchainfile,const char *keyfile,pem_password_cb *passwd_cb)
{
if (!certchainfile) return 0;
if (!keyfile) return 0;
if (SSL_CTX_use_certificate_chain_file(ctx,certchainfile) <= 0)
return -1;
SSL_CTX_set_default_passwd_cb(ctx,passwd_cb);
if (SSL_CTX_use_RSAPrivateKey_file(ctx,keyfile,SSL_FILETYPE_PEM) != 1)
return -2;
if (SSL_CTX_check_private_key(ctx) != 1)
return -3;
return 0;
}

So it must be

SSL_CTX_use_RSAPrivateKey_file(ctx,keyfile,SSL_FILETYPE_PEM)

that's not returning 1. This is an OpenSSL procedure. The
documentation says

SSL_CTX_use_RSAPrivateKey_file() adds the first private RSA key found
in file to ctx.

Perhaps there's something wrong with my private key or something wrong
with the file. I'm running the program as root and I did put the
permissions to the private key as 0600. (Tried more open permissions
too.) It's not clear what the problem with key is. Could I be using
the wrong environment variable? Doesn't look like: main() says:

if ((x = env_get("KEYFILE"))) keyfile = x;
if (keyfile && str_equal(keyfile,"")) keyfile = 0;

Who created my private key? That was certbot (from Let's Encrypt).
Here's my private key.

-----BEGIN PRIVATE KEY-----
MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgbmsZApHJl4/qtrey
gGU0SG4tAVR06Dn48Rjw4G6S65ShRANCAAQf/s6+hjKAh7L4TM27HGEK8+Jw16Kc
vJ+Yw3QGHvHxmJRwyjchdUvunRM048k68UNehuLGyoSqk5tCcxh50lnQ
-----END PRIVATE KEY-----

Could it be that it's too small? No idea.

> (It's not in any of the Linux repositories I use.)

Puzzling.

> Hope that helps.

Helped immensely. Thank you!

Re: sslserver

<5F0NN.724625$xHn7.302218@fx14.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11516&group=comp.unix.programmer#11516

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!news.neodome.net!npeer.as286.net!npeer-ng0.as286.net!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx14.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: sslserver
Newsgroups: comp.unix.programmer
References: <87msqndb7y.fsf@tudado.org> <utsrgt$14tqr$3@dont-email.me> <87il172voe.fsf@tudado.org>
Lines: 17
Message-ID: <5F0NN.724625$xHn7.302218@fx14.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Wed, 27 Mar 2024 21:59:29 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Wed, 27 Mar 2024 21:59:29 GMT
X-Received-Bytes: 1244
 by: Scott Lurndal - Wed, 27 Mar 2024 21:59 UTC

Johanne Fairchild <jfairchild@tudado.org> writes:
>vallor <vallor@cultnix.org> writes:
>

># CERTFILE="/etc/ssl/cert.pem" DHFILE="/etc/ssl/dh2048.pem" \
> sslserver -sH1 0.0.0.0 1234 cat
>1234
>sslserver: fatal: unable to load key

Run it under 'strace', find where it displays the error
message and look just before it to see what open system
call failed and look at the path argument to see what file
it is attempting to open.

$ CERTFILE=... DHFILE=... strace -o /tmp/strace.tr -f sslserver -sH1 0.0.0.0 1234 cat

$ man strace

Re: sslserver

<wwvfrwa21gp.fsf@LkoBDZeT.terraraq.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11517&group=comp.unix.programmer#11517

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!nntp.terraraq.uk!.POSTED.tunnel.sfere.anjou.terraraq.org.uk!not-for-mail
From: inva...@invalid.invalid (Richard Kettlewell)
Newsgroups: comp.unix.programmer
Subject: Re: sslserver
Date: Thu, 28 Mar 2024 08:40:54 +0000
Organization: terraraq NNTP server
Message-ID: <wwvfrwa21gp.fsf@LkoBDZeT.terraraq.uk>
References: <87msqndb7y.fsf@tudado.org> <utsrgt$14tqr$3@dont-email.me>
<87il172voe.fsf@tudado.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: innmantic.terraraq.uk; posting-host="tunnel.sfere.anjou.terraraq.org.uk:172.17.207.6";
logging-data="69974"; mail-complaints-to="usenet@innmantic.terraraq.uk"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:EAjaCDGy9GOkE26Gdf+bXa3ZMpE=
X-Face: h[Hh-7npe<<b4/eW[]sat,I3O`t8A`(ej.H!F4\8|;ih)`7{@:A~/j1}gTt4e7-n*F?.Rl^
F<\{jehn7.KrO{!7=:(@J~]<.[{>v9!1<qZY,{EJxg6?Er4Y7Ng2\Ft>Z&W?r\c.!4DXH5PWpga"ha
+r0NzP?vnz:e/knOY)PI-
X-Boydie: NO
 by: Richard Kettlewell - Thu, 28 Mar 2024 08:40 UTC

Johanne Fairchild <jfairchild@tudado.org> writes:
> SSL_CTX_use_RSAPrivateKey_file() adds the first private RSA key found
> in file to ctx.

As it says, it’s looking for an RSA private key.

> -----BEGIN PRIVATE KEY-----
> MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgbmsZApHJl4/qtrey
> gGU0SG4tAVR06Dn48Rjw4G6S65ShRANCAAQf/s6+hjKAh7L4TM27HGEK8+Jw16Kc
> vJ+Yw3QGHvHxmJRwyjchdUvunRM048k68UNehuLGyoSqk5tCcxh50lnQ
> -----END PRIVATE KEY-----

That is an ECDSA private key.

--
https://www.greenend.org.uk/rjk/

Re: sslserver

<uu5hfr$3e7ne$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11520&group=comp.unix.programmer#11520

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: val...@cultnix.org (vallor)
Newsgroups: comp.unix.programmer
Subject: Re: sslserver
Date: Fri, 29 Mar 2024 04:53:15 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 151
Message-ID: <uu5hfr$3e7ne$2@dont-email.me>
References: <87msqndb7y.fsf@tudado.org> <utsrgt$14tqr$3@dont-email.me>
<87il172voe.fsf@tudado.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 29 Mar 2024 04:53:16 +0100 (CET)
Injection-Info: dont-email.me; posting-host="8c835e08cbef8e0164ef1a54f406307d";
logging-data="3612398"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+i3A43zOh4PnCY0MzGCLXb"
User-Agent: Pan/0.155 (Kherson; 578af3b gitlab.gnome.org/GNOME/pan.git;
x86_64-pc-linux-gnu)
Cancel-Lock: sha1:RRbe23Kaosb1J21/gItNZZ3m1nM=
X-Face: \}2`P"_@pS86<'EM:'b.Ml}8IuMK"pV"?FReF$'c.S%u9<Q#U*4QO)$l81M`{Q/n
XL'`91kd%N::LG:=*\35JS0prp\VJN^<s"b#bff@fA7]5lJA.jn,x_d%Md$,{.EZ
 by: vallor - Fri, 29 Mar 2024 04:53 UTC

On Wed, 27 Mar 2024 18:48:17 -0300, Johanne Fairchild
<jfairchild@tudado.org> wrote in <87il172voe.fsf@tudado.org>:

> vallor <vallor@cultnix.org> writes:
>
>> On Sun, 24 Mar 2024 10:13:21 -0300, Johanne Fairchild
>> <jfairchild@tudado.org> wrote in <87msqndb7y.fsf@tudado.org>:
>>
>>> I'm running a brand new FreeBSD 13.2-RELEASE-p10. I installed the
>>> pkg-package ucspi-ssl-0.99b_1. I never used it, so I don't know what
>>> to expect. Can you explain what I should do about this error?
>>>
>>> %sslserver 0 1031 cat sslserver: fatal: unable to set DH parameters
>>>
>>> Instead of 0 (as in bind all interfaces) I also tried an IP address, a
>>> hostname such as ``localhost'' et cetera. Unable to set DH parameters
>>> sounds like cryptography bureaucracy. The DH might stand for
>>> diffie-hellman. Perhaps the software doesn't know how to locate some
>>> configuration it needs? The website of the program is at
>>>
>>> https://www.fehcom.de/ipnet/ucspi-ssl.html
>>>
>>> but it doesn't seem to have documentation for a newcomer.
>>
>> A quick look around shows it's a hard-to-find tool.
>
> Indeed. I wonder why. Such a useful tool.
>
>> Looks like step 8 in this document, which might help:
>>
>> https://github.com/meixler/installing-configuring-and-running-ucspi-
ssl-sslserver
>
> This is wonderful.
>
> --8<---------------cut here---------------start------------->8---
> It took me a fair amount of time (and Googling, and trial-and-error,
> and even some help from Erwin Hoffman) to get ucspi-ssl sslserver up
> and running, as there are a number of nuances in the process. So, I
> thought I would document the steps that worked for me to get ucspi-ssl
> sslserver up and running to have as a reference for myself, as well as
> for others that may find this useful.
> --8<---------------cut here---------------end--------------->8---
>
> I'm still missing at least one step. I followed the guide above, but
> sslserver still misses a key.
>
> # CERTFILE="/etc/ssl/cert.pem" DHFILE="/etc/ssl/dh2048.pem" \
> sslserver -sH1 0.0.0.0 1234 cat
> 1234 sslserver: fatal: unable to load key
>
> The documentation mentions the KEYFILE environment variable, so I
> thought that could be it. I said
>
> # CERTFILE="/etc/ssl/nntp-cert.pem" \
> DHFILE="/etc/ssl/dh2048.pem" \
> KEYFILE=/etc/ssl/nntp-key.pem sslserver -sH1 0.0.0.0 1234 cat
> 1234 sslserver: fatal: unable to load key
>
> Same thing. Looking at the source code, the failure happens here in
> main():
>
> if (certchainfile) {
> switch (ssl_chainfile(ctx,certchainfile,keyfile,passwd_cb)) {
> case -1: strerr_die2x(111,FATAL,"unable to load certificate chain
> file");
> case -2: strerr_die2x(111,FATAL,"unable to load key");
> case -3: strerr_die2x(111,FATAL,"key does not match
> certificate"); default: break;
> }
> }
>
> Looking at ssl_chainfile(), we find:
>
> int ssl_chainfile(SSL_CTX *ctx,const char *certchainfile,const char
> *keyfile,pem_password_cb *passwd_cb)
> {
> if (!certchainfile) return 0;
> if (!keyfile) return 0;
>
> if (SSL_CTX_use_certificate_chain_file(ctx,certchainfile) <= 0)
> return -1;
>
> SSL_CTX_set_default_passwd_cb(ctx,passwd_cb);
> if (SSL_CTX_use_RSAPrivateKey_file(ctx,keyfile,SSL_FILETYPE_PEM) !=
> 1)
> return -2;
>
> if (SSL_CTX_check_private_key(ctx) != 1)
> return -3;
>
> return 0;
> }
>
> So it must be
>
> SSL_CTX_use_RSAPrivateKey_file(ctx,keyfile,SSL_FILETYPE_PEM)
>
> that's not returning 1. This is an OpenSSL procedure. The
> documentation says
>
> SSL_CTX_use_RSAPrivateKey_file() adds the first private RSA key found
> in file to ctx.
>
> Perhaps there's something wrong with my private key or something wrong
> with the file. I'm running the program as root and I did put the
> permissions to the private key as 0600. (Tried more open permissions
> too.) It's not clear what the problem with key is. Could I be using
> the wrong environment variable? Doesn't look like: main() says:
>
> if ((x = env_get("KEYFILE"))) keyfile = x;
> if (keyfile && str_equal(keyfile,"")) keyfile = 0;
>
> Who created my private key? That was certbot (from Let's Encrypt).
> Here's my private key.
>
> -----BEGIN PRIVATE KEY-----
> MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgbmsZApHJl4/qtrey
> gGU0SG4tAVR06Dn48Rjw4G6S65ShRANCAAQf/s6+hjKAh7L4TM27HGEK8+Jw16Kc
> vJ+Yw3QGHvHxmJRwyjchdUvunRM048k68UNehuLGyoSqk5tCcxh50lnQ -----END
> PRIVATE KEY-----
>
> Could it be that it's too small? No idea.
>
>> (It's not in any of the Linux repositories I use.)
>
> Puzzling.
>
>> Hope that helps.
>
> Helped immensely. Thank you!

Hello,

The howto I linked to has two "step 8"'s. Hmm.
Anyway, in the second "step 8", it has you copy the cert
from the LetsEncrypt /etc directory.

I haven't tried it, but I think your error would be consistent
with missing the chain certificate. If memory serves, the site cert
and the chain cert are both in the file "fullchain.pem". Perhaps
try copying that one instead.

(Personally, I'd point the key- and cert-file environment variables
at the links in the LetsEncrypt /etc directory, so that 3 months from
now, all you have to do is run "certbot renew" to get the new cert
installed. At that time, you'll probably have to restart sslserver
to pick up the new files.)

--
-v

Re: sslserver

<uu5jub$3e7ne$4@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11521&group=comp.unix.programmer#11521

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: val...@cultnix.org (vallor)
Newsgroups: comp.unix.programmer
Subject: Re: sslserver
Date: Fri, 29 Mar 2024 05:35:07 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <uu5jub$3e7ne$4@dont-email.me>
References: <87msqndb7y.fsf@tudado.org> <utsrgt$14tqr$3@dont-email.me>
<87il172voe.fsf@tudado.org> <uu5hfr$3e7ne$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 29 Mar 2024 05:35:08 +0100 (CET)
Injection-Info: dont-email.me; posting-host="8c835e08cbef8e0164ef1a54f406307d";
logging-data="3612398"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19pOcGc/Ljt4PczheH44i5x"
User-Agent: Pan/0.155 (Kherson; 578af3b gitlab.gnome.org/GNOME/pan.git;
x86_64-pc-linux-gnu)
Cancel-Lock: sha1:ZZ3O0/yy6S6mfWbimcACEG66fh0=
X-Face: \}2`P"_@pS86<'EM:'b.Ml}8IuMK"pV"?FReF$'c.S%u9<Q#U*4QO)$l81M`{Q/n
XL'`91kd%N::LG:=*\35JS0prp\VJN^<s"b#bff@fA7]5lJA.jn,x_d%Md$,{.EZ
 by: vallor - Fri, 29 Mar 2024 05:35 UTC

On Fri, 29 Mar 2024 04:53:15 -0000 (UTC), vallor <vallor@cultnix.org>
wrote in <uu5hfr$3e7ne$2@dont-email.me>:

> Hello,
>
> The howto I linked to has two "step 8"'s. Hmm.
> Anyway, in the second "step 8", it has you copy the cert from the
> LetsEncrypt /etc directory.
>
> I haven't tried it, but I think your error would be consistent with
> missing the chain certificate. If memory serves, the site cert and the
> chain cert are both in the file "fullchain.pem". Perhaps try copying
> that one instead.
>
> (Personally, I'd point the key- and cert-file environment variables at
> the links in the LetsEncrypt /etc directory, so that 3 months from now,
> all you have to do is run "certbot renew" to get the new cert installed.
> At that time, you'll probably have to restart sslserver to pick up the
> new files.)

Sketchy though it is, I went through the gyrations to build this hairy
monster. Saw this in the man page for sslserver:

$CERTCHAINFILE=path
If set, overrides the compiled-in certificate
chainfile name. The server presents this list of
certificats to clients. Note: Providing
$CERTCHAINFILE has precedence over $CERTFILE.
Certificates in this file needs to be 'ordered'
starting from the uppermost root certificates and
placing your host's certificate at the end.

So looks like you use that with the full chain file.
--
-v

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor