Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pingap in docker does not create certificate correctly by acme #85

Closed
podpress opened this issue Jan 24, 2025 · 21 comments
Closed

Pingap in docker does not create certificate correctly by acme #85

podpress opened this issue Jan 24, 2025 · 21 comments
Assignees
Labels
bug Something isn't working stale

Comments

@podpress
Copy link

Image
-> http://staging.swiftpress.io/

Image

@podpress
Copy link
Author

Image

@vicanso
Copy link
Owner

vicanso commented Jan 24, 2025

Would you mind providing the complete configuration?

Image

@adammakowskidev
Copy link

Hi @vicanso
We are working together with @podpress .
What can this error mean for https?

Error message
write EPROTO 0078E828A77F0000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:354:

@podpress
Copy link
Author

I'd like to add onto this again, still seeing:

HTTPStatus context: Io error No such file or directory (os error 2), /opt/pingap/conf/pingap-acme-tokens/TLO1MdHO4ZZJOswJ85p8cFSB4ZsrDkeA1GMtNRZgkBg cause: InternalError

Regardless of Docker environment, I've tried EFS, NFS, S3, bare-metal docker, nothing is fixing this error.

@podpress
Copy link
Author

cache_directory = "/var/cache"
cache_max_size = "100.0 MB"
log_level = "INFO"
user = "root"

[certificates."proxy.swiftpress.io"]
acme = "lets_encrypt"
domains = "proxy.swiftpress.io"

[certificates."www.hosting-benchmark.myft.cloud"]
acme = "lets_encrypt"
domains = "www.hosting-benchmark.myft.cloud"
tls_cert = """
-----BEGIN CERTIFICATE-----
MIIDozCCAyigAwIBAgISBOGHik/mK8y8aFR2COZl5b42MAoGCCqGSM49BAMDMDIx
CzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MQswCQYDVQQDEwJF
NTAeFw0yNTAxMTExMjA0NTdaFw0yNTA0MTExMjA0NTZaMCsxKTAnBgNVBAMTIHd3
dy5ob3N0aW5nL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1nJ/Pwt8LQZBfOFyV
XP8ubAp/au3dc4EKWG9MO5zcx1qT9+NXRGdVWxGvmBFRAajciMfXME1ZuGmk3/GO
koAM7ZkjZmleyokP1LGzmfJcUd9s7eeu1/9/eg5XlXd/55GtYjAM+C4DG5i7eaNq
cm2F+yxYIPt6cbbtYVNJCGfHWqHEQ4FYStUyFnv8sjyqU8ypgZaNJ9aVcWSICLOI
E1/Qv/7oKsnZCWJ926wU6RqG1OYPGOi1zuABhLw61cuPVDT28nQS/e6z95cJXq0e
K1BcaJ6fJZsmbjRgD5p3mvEf5vdQM7MCEvU0tHbsx2I5mHHJoABHb8KVBgWp/lcX
GWiWaeOyB7RP+OfDtvi2OsapxXiV7vNVs7fMlrRjY1joKaqmmycnBvAq14AEbtyL
sVfOS66B8apkeFX2NY4XPEYV4ZSCe8VHPrdrERk2wILG3T/EGmSIkCYVUMSnjmJd
VQD9F6Na/+zmXCc=
-----END CERTIFICATE-----
"""
tls_key = """
-----BEGIN PRIVATE KEY-----
MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgS5hq357RI9nT2Foh
Z7GODDRSQl3Y+RJFZ2h/nvK9TVmhRANCAAQmX0VQsD4Nqh96hwMBYb91DbvjOFuM
9vY6hCdjQXRXct2vqQiYCSgsFFE0KthHYOXUndET2F7vUXXKQp9BvbGh
-----END PRIVATE KEY-----
"""

[locations."proxy.swiftpress.io"]
host = "proxy.swiftpress.io"
plugins = [
    "Cache",
    "Compression",
    "pingap:stats",
    "pingap:requestId",
    "Encoding",
    "Response",
]
proxy_add_headers = ["cache-control:max-age=3600"]
proxy_set_headers = ["cache-control:max-age=3600"]
upstream = "77.68.81.111"

[locations."www.hosting-benchmark.myft.cloud"]
enable_reverse_proxy_headers = true
host = "www.hosting-benchmark.myft.cloud"
plugins = [
    "pingap:requestId",
    "pingap:acceptEncodingAdjustment",
]
proxy_set_headers = [
    "Host:www.hosting-benchmark.myft.cloud",
    "Access-Control-Allow-Origin:*",
]
upstream = "hosting-benchmark.myft.cloud"

[plugins.Cache]
category = "cache"
check_cache_control = false
eviction = false
headers = ["x-swiftpress"]
max_file_size = "1gb"
max_ttl = "1h"

[plugins.Compression]
br_level = 11
category = "compression"
decompression = true
gzip_level = 9
zstd_level = 22

[plugins.Encoding]
category = "accept_encoding"
encodings = "zstd,br,gzip"
only_one_encoding = true

[plugins.Response]
add_headers = []
category = "response_headers"
remove_headers = ["server"]
set_headers = []
set_headers_not_exists = ["cache-control:max-age=3600"]

[servers.HTTP]
addr = "0.0.0.0:80"
enabled_h2 = true
global_certificates = false
locations = [
    "www.hosting-benchmark.myft.cloud",
    "proxy.swiftpress.io",
]

[servers.HTTPS]
addr = "0.0.0.0:443"
enabled_h2 = true
global_certificates = true
locations = ["www.hosting-benchmark.myft.cloud"]
threads = 1
tls_max_version = "tlsv1.3"
tls_min_version = "tlsv1.2"

[upstreams."77.68.81.111"]
addrs = ["77.68.81.111"]
alpn = "H2H1"
discovery = "common"
enable_tracer = true
tcp_fast_open = true
update_frequency = "30s"

[upstreams."hosting-benchmark.myft.cloud"]
addrs = ["hosting-benchmark.myft.cloud"]
alpn = "H2"
discovery = "common"
enable_tracer = true
ipv4_only = false
sni = "hosting-benchmark.myft.cloud"
tcp_fast_open = true
update_frequency = "30s"
verify_cert = true```

@vicanso
Copy link
Owner

vicanso commented Jan 25, 2025

Hi @vicanso We are working together with @podpress . What can this error mean for https?

Error message
write EPROTO 0078E828A77F0000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:354:

It can be confirmed that the TLS version supported by the client?

@vicanso
Copy link
Owner

vicanso commented Jan 25, 2025

I'd like to add onto this again, still seeing:

HTTPStatus context: Io error No such file or directory (os error 2), /opt/pingap/conf/pingap-acme-tokens/TLO1MdHO4ZZJOswJ85p8cFSB4ZsrDkeA1GMtNRZgkBg cause: InternalError

Regardless of Docker environment, I've tried EFS, NFS, S3, bare-metal docker, nothing is fixing this error.

Are there multiple pingap instances?

@vicanso
Copy link
Owner

vicanso commented Jan 25, 2025

[servers.HTTP]
addr = "0.0.0.0:80"
enabled_h2 = true
global_certificates = false
locations = [
    "www.hosting-benchmark.myft.cloud",
    "proxy.swiftpress.io",
]


[locations."proxy.swiftpress.io"]
host = "proxy.swiftpress.io"

The host is proxy.swiftpress.io, you should be visit http://proxy.swiftpress.io/.

@podpress
Copy link
Author

podpress commented Jan 25, 2025

I'd like to add onto this again, still seeing:
HTTPStatus context: Io error No such file or directory (os error 2), /opt/pingap/conf/pingap-acme-tokens/TLO1MdHO4ZZJOswJ85p8cFSB4ZsrDkeA1GMtNRZgkBg cause: InternalError
Regardless of Docker environment, I've tried EFS, NFS, S3, bare-metal docker, nothing is fixing this error.

Are there multiple pingap instances?

Just one. I cannot get it to generate at all. I think the Docker version is borked as fuck.

@vicanso
Copy link
Owner

vicanso commented Jan 25, 2025

Does pingap have write permission to this directory?

@podpress
Copy link
Author

Does pingap have write permission to this directory?

Yes, it does, or it wouldn't be able to write the conf directory, or any of the conf toml.

@vicanso
Copy link
Owner

vicanso commented Jan 25, 2025

Can you get all logs of acme? You can use grep 'category="acme"'.

And please confirm whether the folder /opt/pingap/conf/pingap-acme-tokens exists or not.

2025-01-25T11:17:56.206563+08:00  INFO pingap::acme::lets_encrypt: acme from let's encrypt category="acme" domains="pingap.io"
2025-01-25T11:18:01.145406+08:00  INFO pingap::acme::lets_encrypt: acme from let's encrypt category="acme" status="Pending"
2025-01-25T11:18:01.147462+08:00  INFO pingap::acme::lets_encrypt: let's encrypt well known path category="acme" token="n72C4sQcGNER7BPL3LpsVZVC4sQLE8EaB8VPlZSt4AE"
2025-01-25T11:18:01.929701+08:00  INFO pingap::acme::lets_encrypt: order is not ready, waiting category="acme" delay="500ms"

@vicanso vicanso self-assigned this Jan 25, 2025
@vicanso vicanso added the question Further information is requested label Jan 25, 2025
@podpress
Copy link
Author

No this is what I have been saying /opt/pingap/conf/pingap-acme-tokens doesn't exist, isn't created.

@adammakowskidev
Copy link

In short:
Everything works fine in docker build except creating certificates.
http server works, plugins, upstreams, locations etc.
Pingap in docker version cannot create the acme token folder and files in it itself. Configurations all with toml files work and are created correctly.

@vicanso
Copy link
Owner

vicanso commented Jan 26, 2025

OK, I'll test the docker image.

@vicanso
Copy link
Owner

vicanso commented Jan 26, 2025

@adammakowskidev @podpress

Please try to add -v /etc/ssl:/etc/ssl:ro \ for docker run command.

@vicanso
Copy link
Owner

vicanso commented Jan 28, 2025

@adammakowskidev @podpress

Does it work?

@vicanso vicanso added bug Something isn't working and removed question Further information is requested labels Jan 28, 2025
@vicanso vicanso changed the title Pingap on latest Docker doesn't seem to pickup locations at all. Pingap in docker does not create certificate correctly by acme Jan 28, 2025
@podpress
Copy link
Author

No sorry, it does not.

@vicanso
Copy link
Owner

vicanso commented Jan 28, 2025

Can you grep the logs using this grep 'acme'? It's like this:

2025-01-28T13:00:38.125152944Z ERROR failed to get certificate category="acme" error=Let's Encrypt operation failed: X509 error, category: parse_x509_pem, Parsing Error: MissingHeader, category: new_certificate name="pingap"
2025-01-28T13:00:38.125159113Z  INFO acme from let's encrypt category="acme" domains="pingap.io"
2025-01-28T13:00:38.125229746Z ERROR certificate renewal failed, will retry later category="acme" error=ACME instant error: no native root CA certificates found (errors: []), category: create_account domains="pingap.io" name="pingap"

@vicanso
Copy link
Owner

vicanso commented Feb 4, 2025

@podpress

Is the problem solved?

@vicanso vicanso added the stale label Feb 18, 2025
@vicanso
Copy link
Owner

vicanso commented Feb 18, 2025

This issue has been closed because it has been stalled with no activity.

@vicanso vicanso closed this as completed Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

3 participants