Skip to content

Commit

Permalink
Add better tls support.
Browse files Browse the repository at this point in the history
  • Loading branch information
masv3971 committed Apr 11, 2024
1 parent bf2fa65 commit f76b7c6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions dev_config_docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ persistent:
apigw:
api_server:
addr: :8080
tls:
enabled: false
cert_file_path: ""
key_file_path: ""

py_pdfsigner:
sign_queue_name: sign
Expand Down
4 changes: 2 additions & 2 deletions dockerfiles/worker
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ ARG SERVICE_NAME

WORKDIR /

RUN apt-get update && apt-get install -y curl procps iputils-ping less
RUN apt-get update && apt-get install -y curl procps iputils-ping less coreutils file netcat-openbsd
RUN rm -rf /var/lib/apt/lists/*

COPY --from=builder /go/src/app/bin/vc_${SERVICE_NAME} /vc_service
COPY --from=builder /go/src/app/docs /docs

EXPOSE 8080

HEALTHCHECK --interval=20s --timeout=10s CMD curl --connect-timeout 5 http://localhost:8080/health | grep -q STATUS_OK
HEALTHCHECK --interval=20s --timeout=10s CMD curl --insecure --connect-timeout 5 https://localhost:8080/health | grep -q STATUS_OK

# vars in CMD and ENTRYPOINT are evaluated at runtime, that's why we use a static name on the binary.
CMD [ "./vc_service" ]
4 changes: 3 additions & 1 deletion internal/apigw/httpserver/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import (
)

func (s *Service) applyTLSConfig(ctx context.Context) {
ctx, span := s.tp.Start(ctx, "httpserver:applyTLSConfig")
defer span.End()

cfg := &tls.Config{
MinVersion: tls.VersionTLS12,
CurvePreferences: []tls.CurveID{tls.CurveP521, tls.CurveP384, tls.CurveP256},
PreferServerCipherSuites: true,
}

Expand Down

0 comments on commit f76b7c6

Please sign in to comment.