[lxc-users] The error "ALPN, server did not agree to a protocol" from LXD Rest API

Hiroaki Nakamura hnakamur at gmail.com
Fri May 6 19:29:18 UTC 2016


Hi all,

I tried to use the LXC Rest API with curl on Ubuntu 16.04 LTS, but I
got the following error:
> * ALPN, server did not agree to a protocol

https://github.com/lxc/lxd#using-the-rest-api
https://github.com/lxc/lxd/blob/master/doc/rest-api.md#10

Here is the command I tried and the output:

$ curl -k -v --cert ~/.config/lxc/client.crt --key
~/.config/lxc/client.key 'https://127.0.0.1:8443/1.0'
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 8443 (#0)
* found 173 certificates in /etc/ssl/certs/ca-certificates.crt
* found 692 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256
*        server certificate verification SKIPPED
*        server certificate status verification SKIPPED
*        common name: root at express (does not match '127.0.0.1')
*        server certificate expiration date OK
*        server certificate activation date OK
*        certificate public key: RSA
*        certificate version: #3
*        subject: O=linuxcontainers.org,CN=root at express
*        start date: Tue, 03 May 2016 11:26:51 GMT
*        expire date: Fri, 01 May 2026 11:26:51 GMT
*        issuer: O=linuxcontainers.org,CN=root at express
*        compression: NULL
* ALPN, server did not agree to a protocol
> GET /1.0 HTTP/1.1
> Host: 127.0.0.1:8443
> User-Agent: curl/7.47.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: application/json
< Date: Fri, 06 May 2016 19:18:47 GMT
< Content-Length: 162
<
{"type":"sync","status":"Success","status_code":200,"metadata":{"api_extensions":[],"api_status":"stable","api_version":"1.0","auth":"untrusted","public":false}}
* Connection #0 to host 127.0.0.1 left intact

$ lxd --version
2.0.0
$ curl --version
curl 7.47.0 (x86_64-pc-linux-gnu) libcurl/7.47.0 GnuTLS/3.4.10
zlib/1.2.8 libidn/1.32 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps
pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM
NTLM_WB SSL libz TLS-SRP UnixSockets

How to fix this error?

Regards,
Hiroaki


More information about the lxc-users mailing list