David,
Stunnel doesn't like your key file.
Maybe it's not in PEM format, or it does not contain a private key.
Try to open it with a text editor. There should be lines reading
"-----BEGIN RSA PRIVATE KEY-----" and "-----END RSA PRIVATE KEY-----"
with some base64 coded stuff in between.
(There also should be a certificate enclosed in
"-----BEGIN CERTIFICATE-----" and "-----END CERTIFICATE-----", but for
now, stunnel is missing the private key.)
HTH,
Ludolf
--
Ludolf Holzheid
Bihl+Wiedemann GmbH
Floßwörthstraße 41
68199 Mannheim, Germany
Tel: +49 621 33996-0
Fax: +49 621 3392239
mailto:lhol...@bihl-wiedemann.de
http://www.bihl-wiedemann.de
Sitz der Gesellschaft: Mannheim
Geschäftsführer: Jochen Bihl, Bernhard Wiedemann
Amtsgericht Mannheim, HRB 5796
_______________________________________________
stunnel-users mailing list
stunne...@stunnel.org
https://www.stunnel.org/cgi-bin/mailman/listinfo/stunnel-users
Hello David,
Please reply to the list, so others are able to comment too.
I don't know the 'default certificate provided by Stunnel'. I expect
it to be depending on the distribution.
However, if there are "BEGIN/END CERTIFICATE" lines in your file, but
no "BEGIN/END RSA PRIVATE KEY", then the file is in PEM format, but
the key is missing. Maybe you have separate files for private key and
certificate. If this is the case, you may either concatenate key and
certificate to a single file or specify both files in the stunnel
configuration:
>> key = my-private-key.pem
>> cert = my-certificate.pem
I don't know.
Some key/certificate repositories don't allow to export private keys.
Maybe there is a PKCS11 plug-in for OpenSSL to access the keystore.
If this is the case, you don't have to export your private key. But
again, I don't know.
> Additionally, I've thought about configuring Stunnel in client mode.
> Here is the configuration:
> [..]
Running stunnel in client or server mode makes no difference
w.r.t. certificate and key files. As long as stunnel is not able to
access your private key, the client mode won't work either.
HTH,
David,
CAfile should point to a list of trusted certificates. The file(s)
for your pair of certificate and key should be specified with
cert=... (and key=..., if certificate and key are stored to separate
files).
Are the log messages generated at stunnel startup or at connection
establishment?
Then the server presents a certificate that can't be validated against
the trusted certificates stored to the file you specified with
CAfile=...
No, this should be ignored as a comment.
But you instructed stunnel to check the peer's certificate against the
trusted ones (verify = 2), and the certificate chain the peer presents
ends with a certificate not found in the CA file.
Strange. I never used verify = 0, but I had the understanding,
stunnel should accept a connection even if the peer's certificate
can't be verified.
Anyhow, what happens if you add the self-signed certificate presented
by the peer to the CA file?
This self-signed certificate /is/ the current CA certificate, as it is
the root of the peer's certificate chain and you trust it.