I've read numerous forum posts about TLS and Certificates and decided to get help specific to my case.
My environment follows
- A Domain Controller with DNS
- A second Windows Server which is joined to the Domain and has a DNS role too.
- Binary file of exe and configuration
- The 2 servers are VMs and a Domain User that is also a VM connected to each other within VLAN for testing
I configured the Domain Controller DNS to have a Conditonal Forwarding to the DNS to the second Windows Server. DNS resolves properly to the IP address of the second server.
I first tried the traefik dashboard, http works but I want it to be usable on https and route all http to https automatically. The following are my configurations.
traefik.yml
global:
checkNewVersion: false
sendAnonymousUsage: false
serverTransport:
insecureSkipVerify: true
log:
level: DEBUG
entryPoints:
http:
address: ":80"
http:
redirections:
entryPoint:
to: https
scheme: https
https:
address: ":443"
http:
tls: true
providers:
file:
directory: dynamic/
watch: true
api:
dashboard: true
dynamic/traefik.yml
https:
routers:
traefik-dashboard-https:
rule: "Host(`traefik.adm.local`)"
entryPoints: ["https"]
service: "api@internal"
tls: {}
services:
api@internal:
loadBalancer:
servers:
- url: "http://traefik.adm.local:8080"
tls.yml
tls:
stores:
default:
defaultCertificate:
certFile: "C:/xampp/apache/conf/ssl.crt/server.crt"
keyFile: "C:/xampp/apache/conf/ssl.key/server.key"
certificates:
- certFile: "C:/traefik/crt/traefik.adm.local/server.crt"
keyFile: "C:/traefik/crt/traefik.adm.local/server.key"
stores:
- default
- certFile: "C:/traefik/crt/web.adm.local/server.crt"
keyFile: "C:/traefik/crt/web.adm.local/server.key"
stores:
- default
I also created a second site which a xampp dashboard for testing
web.yml
https:
routers:
web:
rule: "Host(`web.adm.local`)"
entryPoints: ["https"]
service: "webhost"
tls : {}
services:
webhost:
loadBalancer:
servers:
- url: "https://web.adm.local:444/dashboard/"
All urls are saved on the server's host file.
Both subdomain of adm.local returns the same error which relates to TLS handshake error and on browser it returns 404 page not found
Log:
2024-12-04T16:25:08+08:00 INF github.com/traefik/traefik/v3/cmd/traefik/traefik.go:103 > Traefik version 3.2.1 built on 2024-11-20T18:10:43Z version=3.2.1
2024-12-04T16:25:08+08:00 DBG github.com/traefik/traefik/v3/cmd/traefik/traefik.go:110 > Static configuration loaded [json] staticConfiguration={"api":{"dashboard":true},"entryPoints":{"http":{"address":":80","forwardedHeaders":{},"http":{"maxHeaderBytes":1048576,"redirections":{"entryPoint":{"permanent":true,"priority":9223372036854775806,"scheme":"https","to":"https"}}},"http2":{"maxConcurrentStreams":250},"transport":{"lifeCycle":{"graceTimeOut":"10s"},"respondingTimeouts":{"idleTimeout":"3m0s","readTimeout":"1m0s"}},"udp":{"timeout":"3s"}},"https":{"address":":443","forwardedHeaders":{},"http":{"maxHeaderBytes":1048576,"tls":{}},"http2":{"maxConcurrentStreams":250},"transport":{"lifeCycle":{"graceTimeOut":"10s"},"respondingTimeouts":{"idleTimeout":"3m0s","readTimeout":"1m0s"}},"udp":{"timeout":"3s"}}},"global":{},"log":{"format":"common","level":"DEBUG"},"providers":{"file":{"directory":"dynamic/","watch":true},"providersThrottleDuration":"2s"},"serversTransport":{"maxIdleConnsPerHost":200},"tcpServersTransport":{"dialKeepAlive":"15s","dialTimeout":"30s"}}
2024-12-04T16:25:08+08:00 INF github.com/traefik/traefik/v3/cmd/traefik/traefik.go:626 >
Stats collection is disabled.
Help us improve Traefik by turning this feature on :)
More details on: https://doc.traefik.io/traefik/contributing/data-collection/
2024-12-04T16:25:08+08:00 DBG github.com/traefik/traefik/v3/pkg/server/server_entrypoint_tcp.go:231 > Starting TCP Server entryPointName=https
2024-12-04T16:25:08+08:00 DBG github.com/traefik/traefik/v3/pkg/server/server_entrypoint_tcp.go:231 > Starting TCP Server entryPointName=http
2024-12-04T16:25:08+08:00 INF github.com/traefik/traefik/v3/pkg/server/configurationwatcher.go:73 > Starting provider aggregator *aggregator.ProviderAggregator
2024-12-04T16:25:08+08:00 INF github.com/traefik/traefik/v3/pkg/provider/aggregator/aggregator.go:202 > Starting provider *file.Provider
2024-12-04T16:25:08+08:00 DBG github.com/traefik/traefik/v3/pkg/provider/aggregator/aggregator.go:203 > *file.Provider provider configuration config={"directory":"dynamic/","watch":true}
2024-12-04T16:25:08+08:00 DBG github.com/traefik/traefik/v3/pkg/provider/file/file.go:122 > add watcher on: dynamic/
2024-12-04T16:25:08+08:00 DBG github.com/traefik/traefik/v3/pkg/provider/file/file.go:122 > add watcher on: dynamic/tls.yml
2024-12-04T16:25:08+08:00 DBG github.com/traefik/traefik/v3/pkg/provider/file/file.go:122 > add watcher on: dynamic/traefik.yml
2024-12-04T16:25:08+08:00 DBG github.com/traefik/traefik/v3/pkg/provider/file/file.go:122 > add watcher on: dynamic/web.yml
2024-12-04T16:25:08+08:00 INF github.com/traefik/traefik/v3/pkg/provider/aggregator/aggregator.go:202 > Starting provider *traefik.Provider
2024-12-04T16:25:08+08:00 INF github.com/traefik/traefik/v3/pkg/provider/aggregator/aggregator.go:202 > Starting provider *acme.ChallengeTLSALPN
2024-12-04T16:25:08+08:00 DBG github.com/traefik/traefik/v3/pkg/provider/aggregator/aggregator.go:203 > *traefik.Provider provider configuration config={}
2024-12-04T16:25:08+08:00 DBG github.com/traefik/traefik/v3/pkg/server/configurationwatcher.go:227 > Configuration received config={"http":{},"tcp":{},"tls":{"stores":{"default":{}}},"udp":{}} providerName=file
2024-12-04T16:25:08+08:00 DBG github.com/traefik/traefik/v3/pkg/provider/aggregator/aggregator.go:203 > *acme.ChallengeTLSALPN provider configuration config={}
2024-12-04T16:25:08+08:00 DBG github.com/traefik/traefik/v3/pkg/server/configurationwatcher.go:227 > Configuration received config={"http":{"middlewares":{"redirect-http-to-https":{"redirectScheme":{"permanent":true,"port":"443","scheme":"https"}}},"models":{"https":{"tls":{}}},"routers":{"http-to-https":{"entryPoints":["http"],"middlewares":["redirect-http-to-https"],"priority":9223372036854775806,"rule":"HostRegexp(`^.+$`)","ruleSyntax":"v3","service":"noop@internal"}},"serversTransports":{"default":{"maxIdleConnsPerHost":200}},"services":{"api":{},"dashboard":{},"noop":{}}},"tcp":{"serversTransports":{"default":{"dialKeepAlive":"15s","dialTimeout":"30s"}}},"tls":{},"udp":{}} providerName=internal
2024-12-04T16:25:08+08:00 DBG github.com/traefik/traefik/v3/pkg/tls/certificate.go:132 > Adding certificate for domain(s) scms-dev.com,web.adm.local
2024-12-04T16:25:08+08:00 DBG github.com/traefik/traefik/v3/pkg/tls/certificate.go:132 > Adding certificate for domain(s) scms-dev.com,traefik.adm.local
2024-12-04T16:25:08+08:00 DBG github.com/traefik/traefik/v3/pkg/middlewares/redirect/redirect_scheme.go:29 > Creating middleware entryPointName=http middlewareName=redirect-http-to-https@internal middlewareType=RedirectScheme routerName=http-to-https@internal
2024-12-04T16:25:08+08:00 DBG github.com/traefik/traefik/v3/pkg/middlewares/redirect/redirect_scheme.go:30 > Setting up redirection to https 443 entryPointName=http middlewareName=redirect-http-to-https@internal middlewareType=RedirectScheme routerName=http-to-https@internal
2024-12-04T16:25:08+08:00 DBG github.com/traefik/traefik/v3/pkg/middlewares/recovery/recovery.go:25 > Creating middleware entryPointName=http middlewareName=traefik-internal-recovery middlewareType=Recovery
2024-12-04T16:25:12+08:00 DBG log/log.go:245 > http: TLS handshake error from 192.168.30.2:50520: remote error: tls: unknown certificate
2024-12-04T16:25:12+08:00 DBG log/log.go:245 > http: TLS handshake error from 192.168.30.2:50521: remote error: tls: unknown certificate
2024-12-04T16:25:27+08:00 DBG log/log.go:245 > http: TLS handshake error from 192.168.30.2:50553: remote error: tls: unknown certificate
2024-12-04T16:50:28+08:00 DBG log/log.go:245 > http: TLS handshake error from 127.0.0.1:50543: remote error: tls: unknown certificate
2024-12-04T16:50:32+08:00 DBG log/log.go:245 > http: TLS handshake error from 127.0.0.1:50548: remote error: tls: unknown certificate
A headstart where to debug will be great. Thanks!