Https error on to() with --skip-verify

Hi there,

I’m trying to transfer data from one bucket to another bucket in a different org on the same host.
The query I’m using is this one:

influx query --org OrgA --skip-verify -t $TOKEN ‘from(bucket:“MyBucket”) |> range(start: 2023-12-06T00:00:00Z, stop: 2024-12-01T00:00:00Z) |> to(bucket: “MyBucket”, org: “OrgB”, host:“https:// $HOSTNAME :8086”, token:$TOKEN)’

The db container has valid SSL Certificates, and can be reached with no issues. But I’m still getting the following error Message:

Error: failed to execute query: 500 Internal Server Error: runtime error @1:100-1:290: to: Post “https:// $HOSTNAME :8086/api/v2/write?bucket=MyBucket&org=OrgB&precision=ns”: tls: failed to verify certificate: x509: certificate signed by unknown authority

To me it looks like the to() command in the query fails and does not recognize the --skip-verify parameter. I have tested the query on a duplicated db without TLS and it worked fine.
Is there anything I’m doing wrong?

I’m using the influx CLI in version Influx CLI dev (git: a79a2a1b825867421d320428538f76a4c90aa34c) build_date: 2024-04-16T14:34:32Z and the db is the offcial 2.7 docker image.

Any help is appreciated
Luke