eXist-db / xst

Command line tool to interact with exist-db instances
https://npmjs.com/@existdb/xst
MIT License
17 stars 4 forks source link

Unable to use HTTP in v1.9.0 #163

Closed daliboris closed 10 months ago

daliboris commented 10 months ago

What happened?

Setting properties "secure" : false, "protocol": "http:" in config file raises an error:

Parse Error: Expected HTTP/

A different combination of properteis ("secure" : false, protocol": "https:") will raise a diffeent error:

Protocol "https:" not supported. Expected "http:"

If use only "protocol": "http:" (withou secure property) following error occurs:

Protocol "http:" not supported. Expected "https:"

System Information

Running xst info --config redaktor.xstrc raises the same errors. Without configuration:

Build: eXist-6.2.0 (c8fa4958b6d4a50bd0cba7f3e76a150226414187)
Java: 11.0.16.1 (Microsoft)
OS: Windows 10 10.0 (amd64)

Relevant shell output

No response

line-o commented 10 months ago

Remove the secure option. The protocol is enough. I tried to make that point clear in the readme. But it should fail with an actionable error.

line-o commented 10 months ago

It's either the deprecated option "secure" or "protocol"

daliboris commented 10 months ago

Using only "protocol": "http:" value leads to different error: Protocol "http:" not supported. Expected "https:"

I don't have HTTPS on my laptop.

line-o commented 10 months ago

Did you set the correct port to use, because the default is 8443?

{
  "connectionOptions": {
    "basic_auth": {
        "user": "admin",
        "pass": ""
    },
    "protocol": "http:",
    "host": "localhost",
    "port": 8080
  }
}
line-o commented 10 months ago

The error indicates that you have a standard exist-db setup listening on both 8080 ('http:') and 8443 ('https:').

line-o commented 10 months ago

@daliboris what happens if you only set

{
  "connectionOptions": {
    "basic_auth": {
        "user": "admin",
        "pass": ""
    }
}
line-o commented 10 months ago

Re-reading your issue I am confident that you are really only missing to set the port to 8080. If that works for you I will close the issue.

line-o commented 10 months ago

It turns out that v1.9.0 was used and the issue is fixed with https://github.com/eXist-db/xst/commit/cf75c70844d839342e20030b540cc4ef40c5316a