@olivierlambert
Sorry to bother everyone but I cannot seem to get xo-server to listen on port 443 even though port 443 is configured in the config.toml. I'm using XOA 5.52.1/5.52.0 and have compiled from community sources using the well known installer script.
The listener configuration part of the config is as follows:
.
.
.
[[http.listen]]
hostname = '0.0.0.0'
port = 443
cert = '/etc/ssl/certs/xoa/xoa.crt'
key = '/etc/ssl/certs/xoa/xoa.key'
# These options are applied to all listen entries.
[http.listenOptions]
# Ciphers to use.
#
# These are the default ciphers in Node 4.2.6, we are setting
# them explicitly for older Node versions.
ciphers = 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA256:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!SRP:!CAMELLIA'
# Tell Node to respect the cipher order.
honorCipherOrder = true
# Specify to use at least TLSv1.1.
# See: https:#github.com/certsimple/minimum-tls-version
secureOptions = 117440512
# redirect HTTP to HTTPS
# redirectToHttps = true
[http.mounts]
'/' = '../xo-web/dist'
.
.
.
The daemon.log shows starting https on port 80 and not 443 as requested in the config:
.
.
.
Nov 25 14:20:24 bfxoa001 systemd[1]: Stopped XO Server.
Nov 25 14:20:24 bfxoa001 systemd[1]: Started XO Server.
Nov 25 14:20:26 bfxoa001 xo-server[4695]: 2019-11-25T13:20:26.992Z xo:main INFO Configuration loaded.
Nov 25 14:20:27 bfxoa001 xo-server[4695]: 2019-11-25T13:20:27.011Z xo:main INFO Web server listening on https://0.0.0.0:80
Nov 25 14:20:27 bfxoa001 xo-server[4695]: Warning: connect.session() MemoryStore is not
Nov 25 14:20:27 bfxoa001 xo-server[4695]: designed for a production environment, as it will leak
Nov 25 14:20:27 bfxoa001 xo-server[4695]: memory, and will not scale past a single process.
Nov 25 14:20:27 bfxoa001 xo-server[4695]: 2019-11-25T13:20:27.782Z xo:main INFO Setting up / → /etc/xo/xo-builds/xen-orchestra-201925111145/packages/xo-web/dist
Nov 25 14:20:27 bfxoa001 xo-server[4695]: 2019-11-25T13:20:27.809Z xo:plugin INFO register auth-github
Nov 25 14:20:27 bfxoa001 xo-server[4695]: 2019-11-25T13:20:27.827Z xo:plugin INFO register auth-google
Nov 25 14:20:27 bfxoa001 xo-server[4695]: 2019-11-25T13:20:27.831Z xo:plugin INFO register auth-ldap
Nov 25 14:20:27 bfxoa001 xo-server[4695]: 2019-11-25T13:20:27.911Z xo:plugin INFO register auth-saml
Nov 25 14:20:28 bfxoa001 xo-server[4695]: 2019-11-25T13:20:28.011Z xo:plugin INFO register backup-reports
Nov 25 14:20:28 bfxoa001 xo-server[4695]: 2019-11-25T13:20:28.015Z xo:plugin INFO register load-balancer
Nov 25 14:20:28 bfxoa001 xo-server[4695]: 2019-11-25T13:20:28.023Z xo:plugin INFO register perf-alert
Nov 25 14:20:28 bfxoa001 xo-server[4695]: 2019-11-25T13:20:28.026Z xo:plugin INFO register sdn-controller
Nov 25 14:20:28 bfxoa001 xo-server[4695]: 2019-11-25T13:20:28.039Z xo:plugin INFO register test
Nov 25 14:20:28 bfxoa001 xo-server[4695]: 2019-11-25T13:20:28.040Z xo:plugin INFO register test-plugin
Nov 25 14:20:28 bfxoa001 xo-server[4695]: 2019-11-25T13:20:28.041Z xo:plugin INFO register transport-email
.
.
.
As reflected in the log I can connect HTTPS via port 80, and verified that the cert is the very one configured.
Uncommenting the redirectToHttps = true has even a more insidious effect - neither port 80 nor 443 work. The daemon.log in this case shows much the same as last time:
.
.
.
Nov 25 14:36:46 bfxoa001 systemd[1]: Stopped XO Server.
Nov 25 14:36:46 bfxoa001 systemd[1]: Started XO Server.
Nov 25 14:36:48 bfxoa001 xo-server[5416]: 2019-11-25T13:36:48.246Z xo:main INFO Configuration loaded.
Nov 25 14:36:48 bfxoa001 xo-server[5416]: 2019-11-25T13:36:48.265Z xo:main INFO Web server listening on https://0.0.0.0:80
Nov 25 14:36:49 bfxoa001 xo-server[5416]: Warning: connect.session() MemoryStore is not
Nov 25 14:36:49 bfxoa001 xo-server[5416]: designed for a production environment, as it will leak
Nov 25 14:36:49 bfxoa001 xo-server[5416]: memory, and will not scale past a single process.
Nov 25 14:36:49 bfxoa001 xo-server[5416]: 2019-11-25T13:36:49.195Z xo:main INFO Setting up / → /etc/xo/xo-builds/xen-orchestra-201925111145/packages/xo-web/dist
Nov 25 14:36:49 bfxoa001 xo-server[5416]: 2019-11-25T13:36:49.197Z xo:plugin INFO register auth-github
Nov 25 14:36:49 bfxoa001 xo-server[5416]: 2019-11-25T13:36:49.209Z xo:plugin INFO register auth-google
Nov 25 14:36:49 bfxoa001 xo-server[5416]: 2019-11-25T13:36:49.213Z xo:plugin INFO register auth-ldap
Nov 25 14:36:49 bfxoa001 xo-server[5416]: 2019-11-25T13:36:49.290Z xo:plugin INFO register auth-saml
Nov 25 14:36:49 bfxoa001 xo-server[5416]: 2019-11-25T13:36:49.393Z xo:plugin INFO register backup-reports
Nov 25 14:36:49 bfxoa001 xo-server[5416]: 2019-11-25T13:36:49.397Z xo:plugin INFO register load-balancer
Nov 25 14:36:49 bfxoa001 xo-server[5416]: 2019-11-25T13:36:49.405Z xo:plugin INFO register perf-alert
Nov 25 14:36:49 bfxoa001 xo-server[5416]: 2019-11-25T13:36:49.409Z xo:plugin INFO register sdn-controller
Nov 25 14:36:49 bfxoa001 xo-server[5416]: 2019-11-25T13:36:49.419Z xo:plugin INFO register test
Nov 25 14:36:49 bfxoa001 xo-server[5416]: 2019-11-25T13:36:49.420Z xo:plugin INFO register test-plugin
Nov 25 14:36:49 bfxoa001 xo-server[5416]: 2019-11-25T13:36:49.421Z xo:plugin INFO register transport-email
Nov 25 14:36:49 bfxoa001 xo-server[5416]: 2019-11-25T13:36:49.463Z xo:plugin INFO register transport-icinga2
Nov 25 14:36:49 bfxoa001 xo-server[5416]: 2019-11-25T13:36:49.464Z xo:plugin INFO register transport-nagios
Nov 25 14:36:49 bfxoa001 xo-server[5416]: 2019-11-25T13:36:49.466Z xo:plugin INFO register transport-slack
Nov 25 14:36:49 bfxoa001 xo-server[5416]: 2019-11-25T13:36:49.578Z xo:plugin INFO register transport-xmpp
Nov 25 14:36:49 bfxoa001 xo-server[5416]: 2019-11-25T13:36:49.633Z xo:plugin INFO register usage-report
Nov 25 14:36:49 bfxoa001 xo-server[5416]: 2019-11-25T13:36:49.736Z xo:plugin INFO register web-hooks
Nov 25 14:36:49 bfxoa001 xo-server[5416]: 2019-11-25T13:36:49.738Z xo:plugin INFO failed register test
.
.
.
Trying to connect to port 80 redirects to port 443. So the redirectToHttps is working, but as there is nothing listening on 443 so, as expected, the connection fails.
More than likely I've done something horribly wrong. I've poured through the old posts and witnessed the conversion from yaml to toml. The closest post that helps is this one, but the final working config was never posted. Additionally the documentation on site has a couple of problems, and missing information:
- parameter host: this should be hostname, no?
- no header # Basic HTTP section: the config file no longer has the comment header # Basic HTTP section shouldn't the doc refer to [[http.listen]] instead, or put the comment header # Basic HTTP section back into the repo?
- support for both HTTPS and HTTP: the stated need for a separate [[http.listen]] section isn't clearly documented. Nor what should be in the section. Are the single bracket sections like [http.mounts] and [http.listenOptions] needed in the new [[http.listen]] for port 80? What is the schema/ hierarchy for the config.toml file?
Again I've probably done something wrong but cannot puzzle out what exactly.