This repository was archived by the owner on Nov 24, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 356
Add SSL Certificate Validation to Traffic Router #3380
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ea34df8
updated tr docker config so it would work
ce6ed87
added start and stop scripts for TR docker containers
7ae40c1
fixed bug in Tomcat which wasn't unregistering old SslHostConfigs
a13a769
Added validation checks of SSL certs while being loaded by Certificat…
da25f4e
Changed error message for Certificate Expired
5165287
Corrected a parsing error in certificate validation checking
b1d89f0
Corrected some code formatting and one NullPointerException
6d2da08
Added info to CHANGELOG.md
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| #!/bin/bash | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| # Script for running the Dockerfile for Traffic Router. | ||
| # The Dockerfile sets up a Docker image which can be used for any new container; | ||
| # This script, which should be run when the container is run (it's the ENTRYPOINT), will configure the container. | ||
| # | ||
| # The following environment variables must be set (ordinarily by `docker run -e` arguments): | ||
| # TRAFFIC_OPS_URI | ||
| # TRAFFIC_OPS_USER | ||
| # TRAFFIC_OPS_PASS | ||
| # TRAFFIC_MONITORS # list of semicolon-delimited FQDN:port monitors. E.g. `monitor.foo.com:80;monitor2.bar.org:80` | ||
| # ORIGIN_URI # origin server (e.g. hotair), used to create a delivery service | ||
|
|
||
| export JAVA_HOME=/usr/java/jdk1.8.0_92/jre | ||
| export CATALINA_PID=/opt/traffic_router/temp/tomcat.pid | ||
| export CATALINA_HOME=/opt/tomcat | ||
| export CATALINA_BASE=/opt/traffic_router | ||
| export CATALINA_OUT=/opt/tomcat/logs/catalina.log | ||
| source /opt/traffic_router/conf/startup.properties | ||
| /opt/tomcat/bin/shutdown.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| #!/bin/bash | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| # Script for running the Dockerfile for Traffic Router. | ||
| # The Dockerfile sets up a Docker image which can be used for any new container; | ||
| # This script simulates the systemd unit file that is used to start traffic router on | ||
| # servers in the real world, but in Docker containers systemd is disabled. | ||
| # Therefore it is important to keep this script up to date with any changes that are | ||
| # made to traffic_router/build/build_rpm.sh and traffic_router/build/pom.xml | ||
|
|
||
| export JAVA_HOME=/usr/java/jdk1.8.0_92/jre | ||
| export CATALINA_PID=/opt/traffic_router/temp/tomcat.pid | ||
| export CATALINA_HOME=/opt/tomcat | ||
| export CATALINA_BASE=/opt/traffic_router | ||
| export CATALINA_OUT=/opt/tomcat/logs/catalina.log | ||
| export CATALINA_OPTS="\ | ||
| -server -Xms512m -Xmx1g \ | ||
| -Dlog4j.configuration=file://$CATALINA_BASE/conf/log4j.properties \ | ||
| -Djava.library.path=/usr/lib64 \ | ||
| -Dorg.apache.catalina.connector.Response.ENFORCE_ENCODING_IN_GET_WRITER=false \ | ||
| -XX:+UseG1GC \ | ||
| -XX:+UnlockExperimentalVMOptions \ | ||
| -XX:InitiatingHeapOccupancyPercent=30" | ||
| export JAVA_OPTS="\ | ||
| -Djava.awt.headless=true \ | ||
| -Djava.security.egd=file:/dev/./urandom" | ||
|
|
||
| ulimit -c unlimited | ||
| /opt/tomcat/bin/startup.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How come? Are you
docker execing into the container to start and stop Traffic Router? What do you gain by doing that without making any changes?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
systemd has been disabled in the centos 7 docker container so we can no longer use the unit files to start/stop processes. The starttr.sh gets called by the run.sh, and yes, I do
docker execto run the shutdown. I also copy in new TR rpms so I can test code changes without having to rebuild the whole Docker image. We have done something similar in CIAB for the TR and ATS containers.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well typically you're not supposed to do that with containers, but I'd like the opinion of someone who actually uses these things - @rob05c , thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this goes back to the whole "containers as VMs" vs "one process per container" thing, which really depends on how the container was designed. These scripts make it seem more like a "container as a VM". That said, I don't really see a problem with adding these scripts to this TR container, but it probably should've been done in a different PR since they don't seem to be required for adding TR SSL cert validation.