<div dir="ltr"><div>I got the point: the server certificate is ECDSA with curve secp256r1.<br></div><div>It works with RSA certificate and curves sepc256r1/sepc384r1/sepc521r1/x25519/x448.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jun 13, 2019 at 3:00 AM Viktor Dukhovni <<a href="mailto:openssl-users@dukhovni.org">openssl-users@dukhovni.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, Jun 12, 2019 at 05:31:30PM +0800, John Jiang wrote:<br>
<br>
> > > Tried below commands,<br>
> > > openssl s_server -trace -state -cert server.cer -key server.key -accept port<br>
> > > openssl s_client -trace -state -CAfile ca.cer -tls1_2 -groups X25519 -connect localhost:port<br>
> ><br>
> > With same commands, using OpenSSL 1.1.1c, I get:<br>
> ><br>
> >     CONNECTION ESTABLISHED<br>
> >     Protocol version: TLSv1.2<br>
> >     Ciphersuite: ECDHE-RSA-AES256-GCM-SHA384<br>
> >     Peer certificate:<br>
> >     Hash used: SHA256<br>
> >     Signature type: RSA-PSS<br>
> >     Supported Elliptic Curve Point Formats: ...<br>
> >     Server Temp Key: X25519, 253 bits<br>
> ><br>
> > Perhaps your s_client is not the one from 1.1.1 or it is dynamically<br>
> > linked against 1.1.0 libraries...<br>
> ><br>
> My s_client can support TLSv1.3, so it should not be from any pre-1.1.1<br>
> version.<br>
<br>
You say that, but the evidence suggests otherwise.  In each of<br>
whatever shells you're using to start the client and server,<br>
it would be prudent to run:<br>
<br>
    $ openssl version -v<br>
<br>
Here's an example with the command and library at the same version:<br>
<br>
    $ /usr/local/bin/openssl version -v<br>
    OpenSSL 1.1.1c  28 May 2019<br>
<br>
And here's another where they differ in the patchlevel:<br>
<br>
    $ LD_PRELOAD=/lib/libcrypto.so.111:/usr/lib/libssl.so.111 /usr/local/bin/openssl version -v<br>
    OpenSSL 1.1.1c  28 May 2019 (Library: OpenSSL 1.1.1a-freebsd  20 Nov 2018)<br>
<br>
Without forcing anything with LD_PRELOAD, ... are your client and<br>
server in fact 1.1.1 in both the executable and the library?<br>
<br>
-- <br>
        Viktor.<br>
</blockquote></div></div>