summaryrefslogtreecommitdiff
path: root/src/mongo/gotools
diff options
context:
space:
mode:
authorKelsey Schubert <kelsey@mongodb.com>2018-04-10 14:01:11 -0400
committerKelsey Schubert <kelsey@mongodb.com>2018-04-10 14:01:11 -0400
commitc1d106adc1c826a129467d447da59fce94a2275f (patch)
tree353b05344f41ed186eb1c178ddcb6ab2f6a8695b /src/mongo/gotools
parentf98493d3112905d2ad988b453b74d9555f5fdac8 (diff)
downloadmongo-c1d106adc1c826a129467d447da59fce94a2275f.tar.gz
Import tools: f5c4a44d3242b97eff9764e1456fe05c1fb6a5b5 from branch master
ref: 636c8d0a8e..f5c4a44d32 for: 3.7.4 TOOLS-1780 Build tools with Go 1.8.x TOOLS-1948 Use Go-native TLS dialer on platforms with openssl 0.9.x TOOLS-1978 tools fail eslint testing TOOLS-1988 Revendor go-openssl TOOLS-1999 Use of --uri overrides use of --ssl TOOLS-2003 Drop SUSE11 from Evergreen builds
Diffstat (limited to 'src/mongo/gotools')
-rw-r--r--src/mongo/gotools/Godeps2
-rw-r--r--src/mongo/gotools/THIRD-PARTY-NOTICES366
-rw-r--r--src/mongo/gotools/common.yml230
-rw-r--r--src/mongo/gotools/common/connstring/connstring.go3
-rw-r--r--src/mongo/gotools/common/db/db_openssl.go (renamed from src/mongo/gotools/common/db/db_ssl.go)2
-rw-r--r--src/mongo/gotools/common/db/db_tlsgo.go26
-rw-r--r--src/mongo/gotools/common/db/openssl/openssl.go2
-rw-r--r--src/mongo/gotools/common/db/openssl/openssl_fips.go2
-rw-r--r--src/mongo/gotools/common/db/tlsgo/config.go242
-rw-r--r--src/mongo/gotools/common/db/tlsgo/rootcerts.go22
-rw-r--r--src/mongo/gotools/common/db/tlsgo/rootcerts_darwin.go60
-rw-r--r--src/mongo/gotools/common/db/tlsgo/tlsgo.go135
-rw-r--r--src/mongo/gotools/common/options/options.go19
-rw-r--r--src/mongo/gotools/common/options/options_openssl.go18
-rw-r--r--src/mongo/gotools/common/options/options_ssl.go6
-rw-r--r--src/mongo/gotools/common/options/options_test.go16
-rw-r--r--src/mongo/gotools/import.data2
-rwxr-xr-xsrc/mongo/gotools/test.sh4
-rw-r--r--src/mongo/gotools/vendor/src/github.com/10gen/openssl/.evergreen/config.yml141
-rw-r--r--src/mongo/gotools/vendor/src/github.com/10gen/openssl/ctx.go17
-rw-r--r--src/mongo/gotools/vendor/src/github.com/10gen/openssl/shim.c6
-rw-r--r--src/mongo/gotools/vendor/src/github.com/10gen/openssl/shim.h8
22 files changed, 1142 insertions, 187 deletions
diff --git a/src/mongo/gotools/Godeps b/src/mongo/gotools/Godeps
index d7baaf77f01..3311863029f 100644
--- a/src/mongo/gotools/Godeps
+++ b/src/mongo/gotools/Godeps
@@ -6,7 +6,7 @@ github.com/smartystreets/assertions 287b4346dc4e71a038c346375a9d572453bc469b
github.com/smartystreets/goconvey bf58a9a1291224109919756b4dcc469c670cc7e4
github.com/jessevdk/go-flags 97448c91aac742cbca3d020b3e769013a420a06f
github.com/3rf/mongo-lint 3550fdcf1f43b89aaeabaa4559eaae6dc4407e42
-github.com/10gen/openssl cbe9e82b6ddfb1d9958d328877404157d313c649
+github.com/10gen/openssl bed982ee200d16c1cfc6c0845d0be025864c1c1b
github.com/spacemonkeygo/spacelog f936fb050dc6b5fe4a96b485a6f069e8bdc59aeb
github.com/howeyc/gopass 44476384cd4721b68705e72f19e95d1a3a504370
github.com/nsf/termbox-go 0723e7c3d0a317dea811f0fbe4d6edd81908c971
diff --git a/src/mongo/gotools/THIRD-PARTY-NOTICES b/src/mongo/gotools/THIRD-PARTY-NOTICES
index 56d56d9f29d..c5bf9453d97 100644
--- a/src/mongo/gotools/THIRD-PARTY-NOTICES
+++ b/src/mongo/gotools/THIRD-PARTY-NOTICES
@@ -1234,3 +1234,369 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+License notice for github.com/hashicorp/go-rootcerts
+----------------------------------------------------
+
+Mozilla Public License, version 2.0
+
+1. Definitions
+
+1.1. "Contributor"
+
+ means each individual or legal entity that creates, contributes to the
+ creation of, or owns Covered Software.
+
+1.2. "Contributor Version"
+
+ means the combination of the Contributions of others (if any) used by a
+ Contributor and that particular Contributor's Contribution.
+
+1.3. "Contribution"
+
+ means Covered Software of a particular Contributor.
+
+1.4. "Covered Software"
+
+ means Source Code Form to which the initial Contributor has attached the
+ notice in Exhibit A, the Executable Form of such Source Code Form, and
+ Modifications of such Source Code Form, in each case including portions
+ thereof.
+
+1.5. "Incompatible With Secondary Licenses"
+ means
+
+ a. that the initial Contributor has attached the notice described in
+ Exhibit B to the Covered Software; or
+
+ b. that the Covered Software was made available under the terms of
+ version 1.1 or earlier of the License, but not also under the terms of
+ a Secondary License.
+
+1.6. "Executable Form"
+
+ means any form of the work other than Source Code Form.
+
+1.7. "Larger Work"
+
+ means a work that combines Covered Software with other material, in a
+ separate file or files, that is not Covered Software.
+
+1.8. "License"
+
+ means this document.
+
+1.9. "Licensable"
+
+ means having the right to grant, to the maximum extent possible, whether
+ at the time of the initial grant or subsequently, any and all of the
+ rights conveyed by this License.
+
+1.10. "Modifications"
+
+ means any of the following:
+
+ a. any file in Source Code Form that results from an addition to,
+ deletion from, or modification of the contents of Covered Software; or
+
+ b. any new file in Source Code Form that contains any Covered Software.
+
+1.11. "Patent Claims" of a Contributor
+
+ means any patent claim(s), including without limitation, method,
+ process, and apparatus claims, in any patent Licensable by such
+ Contributor that would be infringed, but for the grant of the License,
+ by the making, using, selling, offering for sale, having made, import,
+ or transfer of either its Contributions or its Contributor Version.
+
+1.12. "Secondary License"
+
+ means either the GNU General Public License, Version 2.0, the GNU Lesser
+ General Public License, Version 2.1, the GNU Affero General Public
+ License, Version 3.0, or any later versions of those licenses.
+
+1.13. "Source Code Form"
+
+ means the form of the work preferred for making modifications.
+
+1.14. "You" (or "Your")
+
+ means an individual or a legal entity exercising rights under this
+ License. For legal entities, "You" includes any entity that controls, is
+ controlled by, or is under common control with You. For purposes of this
+ definition, "control" means (a) the power, direct or indirect, to cause
+ the direction or management of such entity, whether by contract or
+ otherwise, or (b) ownership of more than fifty percent (50%) of the
+ outstanding shares or beneficial ownership of such entity.
+
+
+2. License Grants and Conditions
+
+2.1. Grants
+
+ Each Contributor hereby grants You a world-wide, royalty-free,
+ non-exclusive license:
+
+ a. under intellectual property rights (other than patent or trademark)
+ Licensable by such Contributor to use, reproduce, make available,
+ modify, display, perform, distribute, and otherwise exploit its
+ Contributions, either on an unmodified basis, with Modifications, or
+ as part of a Larger Work; and
+
+ b. under Patent Claims of such Contributor to make, use, sell, offer for
+ sale, have made, import, and otherwise transfer either its
+ Contributions or its Contributor Version.
+
+2.2. Effective Date
+
+ The licenses granted in Section 2.1 with respect to any Contribution
+ become effective for each Contribution on the date the Contributor first
+ distributes such Contribution.
+
+2.3. Limitations on Grant Scope
+
+ The licenses granted in this Section 2 are the only rights granted under
+ this License. No additional rights or licenses will be implied from the
+ distribution or licensing of Covered Software under this License.
+ Notwithstanding Section 2.1(b) above, no patent license is granted by a
+ Contributor:
+
+ a. for any code that a Contributor has removed from Covered Software; or
+
+ b. for infringements caused by: (i) Your and any other third party's
+ modifications of Covered Software, or (ii) the combination of its
+ Contributions with other software (except as part of its Contributor
+ Version); or
+
+ c. under Patent Claims infringed by Covered Software in the absence of
+ its Contributions.
+
+ This License does not grant any rights in the trademarks, service marks,
+ or logos of any Contributor (except as may be necessary to comply with
+ the notice requirements in Section 3.4).
+
+2.4. Subsequent Licenses
+
+ No Contributor makes additional grants as a result of Your choice to
+ distribute the Covered Software under a subsequent version of this
+ License (see Section 10.2) or under the terms of a Secondary License (if
+ permitted under the terms of Section 3.3).
+
+2.5. Representation
+
+ Each Contributor represents that the Contributor believes its
+ Contributions are its original creation(s) or it has sufficient rights to
+ grant the rights to its Contributions conveyed by this License.
+
+2.6. Fair Use
+
+ This License is not intended to limit any rights You have under
+ applicable copyright doctrines of fair use, fair dealing, or other
+ equivalents.
+
+2.7. Conditions
+
+ Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in
+ Section 2.1.
+
+
+3. Responsibilities
+
+3.1. Distribution of Source Form
+
+ All distribution of Covered Software in Source Code Form, including any
+ Modifications that You create or to which You contribute, must be under
+ the terms of this License. You must inform recipients that the Source
+ Code Form of the Covered Software is governed by the terms of this
+ License, and how they can obtain a copy of this License. You may not
+ attempt to alter or restrict the recipients' rights in the Source Code
+ Form.
+
+3.2. Distribution of Executable Form
+
+ If You distribute Covered Software in Executable Form then:
+
+ a. such Covered Software must also be made available in Source Code Form,
+ as described in Section 3.1, and You must inform recipients of the
+ Executable Form how they can obtain a copy of such Source Code Form by
+ reasonable means in a timely manner, at a charge no more than the cost
+ of distribution to the recipient; and
+
+ b. You may distribute such Executable Form under the terms of this
+ License, or sublicense it under different terms, provided that the
+ license for the Executable Form does not attempt to limit or alter the
+ recipients' rights in the Source Code Form under this License.
+
+3.3. Distribution of a Larger Work
+
+ You may create and distribute a Larger Work under terms of Your choice,
+ provided that You also comply with the requirements of this License for
+ the Covered Software. If the Larger Work is a combination of Covered
+ Software with a work governed by one or more Secondary Licenses, and the
+ Covered Software is not Incompatible With Secondary Licenses, this
+ License permits You to additionally distribute such Covered Software
+ under the terms of such Secondary License(s), so that the recipient of
+ the Larger Work may, at their option, further distribute the Covered
+ Software under the terms of either this License or such Secondary
+ License(s).
+
+3.4. Notices
+
+ You may not remove or alter the substance of any license notices
+ (including copyright notices, patent notices, disclaimers of warranty, or
+ limitations of liability) contained within the Source Code Form of the
+ Covered Software, except that You may alter any license notices to the
+ extent required to remedy known factual inaccuracies.
+
+3.5. Application of Additional Terms
+
+ You may choose to offer, and to charge a fee for, warranty, support,
+ indemnity or liability obligations to one or more recipients of Covered
+ Software. However, You may do so only on Your own behalf, and not on
+ behalf of any Contributor. You must make it absolutely clear that any
+ such warranty, support, indemnity, or liability obligation is offered by
+ You alone, and You hereby agree to indemnify every Contributor for any
+ liability incurred by such Contributor as a result of warranty, support,
+ indemnity or liability terms You offer. You may include additional
+ disclaimers of warranty and limitations of liability specific to any
+ jurisdiction.
+
+4. Inability to Comply Due to Statute or Regulation
+
+ If it is impossible for You to comply with any of the terms of this License
+ with respect to some or all of the Covered Software due to statute,
+ judicial order, or regulation then You must: (a) comply with the terms of
+ this License to the maximum extent possible; and (b) describe the
+ limitations and the code they affect. Such description must be placed in a
+ text file included with all distributions of the Covered Software under
+ this License. Except to the extent prohibited by statute or regulation,
+ such description must be sufficiently detailed for a recipient of ordinary
+ skill to be able to understand it.
+
+5. Termination
+
+5.1. The rights granted under this License will terminate automatically if You
+ fail to comply with any of its terms. However, if You become compliant,
+ then the rights granted under this License from a particular Contributor
+ are reinstated (a) provisionally, unless and until such Contributor
+ explicitly and finally terminates Your grants, and (b) on an ongoing
+ basis, if such Contributor fails to notify You of the non-compliance by
+ some reasonable means prior to 60 days after You have come back into
+ compliance. Moreover, Your grants from a particular Contributor are
+ reinstated on an ongoing basis if such Contributor notifies You of the
+ non-compliance by some reasonable means, this is the first time You have
+ received notice of non-compliance with this License from such
+ Contributor, and You become compliant prior to 30 days after Your receipt
+ of the notice.
+
+5.2. If You initiate litigation against any entity by asserting a patent
+ infringement claim (excluding declaratory judgment actions,
+ counter-claims, and cross-claims) alleging that a Contributor Version
+ directly or indirectly infringes any patent, then the rights granted to
+ You by any and all Contributors for the Covered Software under Section
+ 2.1 of this License shall terminate.
+
+5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user
+ license agreements (excluding distributors and resellers) which have been
+ validly granted by You or Your distributors under this License prior to
+ termination shall survive termination.
+
+6. Disclaimer of Warranty
+
+ Covered Software is provided under this License on an "as is" basis,
+ without warranty of any kind, either expressed, implied, or statutory,
+ including, without limitation, warranties that the Covered Software is free
+ of defects, merchantable, fit for a particular purpose or non-infringing.
+ The entire risk as to the quality and performance of the Covered Software
+ is with You. Should any Covered Software prove defective in any respect,
+ You (not any Contributor) assume the cost of any necessary servicing,
+ repair, or correction. This disclaimer of warranty constitutes an essential
+ part of this License. No use of any Covered Software is authorized under
+ this License except under this disclaimer.
+
+7. Limitation of Liability
+
+ Under no circumstances and under no legal theory, whether tort (including
+ negligence), contract, or otherwise, shall any Contributor, or anyone who
+ distributes Covered Software as permitted above, be liable to You for any
+ direct, indirect, special, incidental, or consequential damages of any
+ character including, without limitation, damages for lost profits, loss of
+ goodwill, work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses, even if such party shall have been
+ informed of the possibility of such damages. This limitation of liability
+ shall not apply to liability for death or personal injury resulting from
+ such party's negligence to the extent applicable law prohibits such
+ limitation. Some jurisdictions do not allow the exclusion or limitation of
+ incidental or consequential damages, so this exclusion and limitation may
+ not apply to You.
+
+8. Litigation
+
+ Any litigation relating to this License may be brought only in the courts
+ of a jurisdiction where the defendant maintains its principal place of
+ business and such litigation shall be governed by laws of that
+ jurisdiction, without reference to its conflict-of-law provisions. Nothing
+ in this Section shall prevent a party's ability to bring cross-claims or
+ counter-claims.
+
+9. Miscellaneous
+
+ This License represents the complete agreement concerning the subject
+ matter hereof. If any provision of this License is held to be
+ unenforceable, such provision shall be reformed only to the extent
+ necessary to make it enforceable. Any law or regulation which provides that
+ the language of a contract shall be construed against the drafter shall not
+ be used to construe this License against a Contributor.
+
+
+10. Versions of the License
+
+10.1. New Versions
+
+ Mozilla Foundation is the license steward. Except as provided in Section
+ 10.3, no one other than the license steward has the right to modify or
+ publish new versions of this License. Each version will be given a
+ distinguishing version number.
+
+10.2. Effect of New Versions
+
+ You may distribute the Covered Software under the terms of the version
+ of the License under which You originally received the Covered Software,
+ or under the terms of any subsequent version published by the license
+ steward.
+
+10.3. Modified Versions
+
+ If you create software not governed by this License, and you want to
+ create a new license for such software, you may create and use a
+ modified version of this License if you rename the license and remove
+ any references to the name of the license steward (except to note that
+ such modified license differs from this License).
+
+10.4. Distributing Source Code Form that is Incompatible With Secondary
+ Licenses If You choose to distribute Source Code Form that is
+ Incompatible With Secondary Licenses under the terms of this version of
+ the License, the notice described in Exhibit B of this License must be
+ attached.
+
+Exhibit A - Source Code Form License Notice
+
+ This Source Code Form is subject to the
+ terms of the Mozilla Public License, v.
+ 2.0. If a copy of the MPL was not
+ distributed with this file, You can
+ obtain one at
+ http://mozilla.org/MPL/2.0/.
+
+If it is not possible or desirable to put the notice in a particular file,
+then You may include the notice in a location (such as a LICENSE file in a
+relevant directory) where a recipient would be likely to look for such a
+notice.
+
+You may add additional accurate notices of copyright ownership.
+
+Exhibit B - "Incompatible With Secondary Licenses" Notice
+
+ This Source Code Form is "Incompatible
+ With Secondary Licenses", as defined by
+ the Mozilla Public License, v. 2.0.
diff --git a/src/mongo/gotools/common.yml b/src/mongo/gotools/common.yml
index d801ac00efb..6bee9ca6ea5 100644
--- a/src/mongo/gotools/common.yml
+++ b/src/mongo/gotools/common.yml
@@ -1569,10 +1569,21 @@ buildvariants:
#######################################
- name: amazonlinux64
- display_name: Amazon Linux 64
+ display_name: Amazon Linux 64 (Go 1.8)
run_on:
- linux-64-amzn-test
expansions:
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go'
+ build_tags: "sasl ssl"
+ tasks:
+ - name: dist
+
+- name: amazon2
+ display_name: Amazon Linux 64 v2 (Go 1.8)
+ run_on:
+ - amazon2-test
+ expansions:
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go'
build_tags: "sasl ssl"
tasks:
- name: dist
@@ -1582,31 +1593,31 @@ buildvariants:
#######################################
- name: debian71
- display_name: Debian 7.1
+ display_name: Debian 7.1 (Go 1.8)
run_on:
- debian71-test
expansions:
- gorootvars: PATH="/opt/go/bin:$PATH"
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go'
build_tags: "sasl ssl"
tasks:
- name: dist
- name: debian81
- display_name: Debian 8.1
+ display_name: Debian 8.1 (Go 1.8)
run_on:
- debian81-test
expansions:
- gorootvars: PATH="/opt/go/bin:$PATH"
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go'
build_tags: "sasl ssl"
tasks:
- name: dist
- name: debian92
- display_name: Debian 9.2
+ display_name: Debian 9.2 (Go 1.8)
run_on:
- debian92-test
expansions:
- gorootvars: PATH="/opt/go/bin:$PATH"
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go'
build_tags: "sasl ssl"
tasks:
- name: dist
@@ -1616,7 +1627,7 @@ buildvariants:
#######################################
- name: macOS-1012
- display_name: MacOS 10.12
+ display_name: MacOS 10.12 (Go 1.8)
run_on:
- macos-1012
expansions:
@@ -1626,11 +1637,11 @@ buildvariants:
mongo_target: "osx-ssl"
arch: "osx/x86_64"
excludes: requires_many_files
- gorootvars: CGO_CPPFLAGS=-I/opt/mongodbtoolchain/v2/include CGO_CFLAGS=-mmacosx-version-min=10.10 CGO_LDFLAGS=-mmacosx-version-min=10.10
+ gorootvars: 'PATH="/usr/local/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/usr/local/go1.8/go'
tasks: *macos_1012_tasks
- name: macOS-1012-ssl
- display_name: MacOS 10.12 SSL
+ display_name: MacOS 10.12 SSL (Go 1.8)
run_on:
- macos-1012
expansions:
@@ -1641,7 +1652,7 @@ buildvariants:
arch: "osx/x86_64"
build_tags: "ssl openssl_pre_1.0"
excludes: requires_many_files
- gorootvars: CGO_CPPFLAGS=-I/opt/mongodbtoolchain/v2/include CGO_CFLAGS=-mmacosx-version-min=10.10 CGO_LDFLAGS=-mmacosx-version-min=10.10
+ gorootvars: 'PATH="/usr/local/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/usr/local/go1.8/go'
tasks: *macos_1012_ssl_tasks
#######################################
@@ -1649,21 +1660,21 @@ buildvariants:
#######################################
- name: rhel62
- display_name: RHEL 6.2
+ display_name: RHEL 6.2 (Go 1.8)
run_on:
- rhel62-test
expansions:
- gorootvars: PATH="/opt/go/bin:$PATH"
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go'
build_tags: "sasl ssl"
tasks:
- name: dist
- name: rhel70
- display_name: RHEL 7.0
+ display_name: RHEL 7.0 (Go 1.8)
run_on:
- rhel70
expansions:
- gorootvars: PATH="/opt/go/bin:$PATH"
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go'
build_tags: "sasl ssl"
tasks:
- name: dist
@@ -1672,20 +1683,12 @@ buildvariants:
# SUSE Buildvariants #
#######################################
-- name: suse11
- display_name: SUSE 11
- run_on:
- - suse11-test
- expansions:
- build_tags: "sasl ssl openssl_pre_1.0"
- tasks:
- - name: dist
-
- name: suse12
- display_name: SUSE 12
+ display_name: SUSE 12 (Go 1.8)
run_on:
- suse12-test
expansions:
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go'
build_tags: "sasl ssl"
tasks:
- name: dist
@@ -1694,17 +1697,8 @@ buildvariants:
# Ubuntu Buildvariants #
#######################################
-- name: ubuntu1204
- display_name: Ubuntu 12.04
- run_on:
- - ubuntu1204-test
- expansions:
- build_tags: "sasl ssl"
- tasks:
- - name: dist
-
- name: ubuntu1404
- display_name: Ubuntu 14.04
+ display_name: Ubuntu 14.04 (Go 1.8)
run_on:
- ubuntu1404-test
expansions:
@@ -1712,6 +1706,7 @@ buildvariants:
<<: *mongo_default_startup_args
mongo_os: "ubuntu1404"
mongo_edition: "targeted"
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go'
build_tags: "sasl ssl"
arch: "linux/x86_64"
integration_test_args: integration
@@ -1719,7 +1714,7 @@ buildvariants:
tasks: *ubuntu1404_tasks
- name: ubuntu1404-ssl
- display_name: Ubuntu 14.04 SSL
+ display_name: Ubuntu 14.04 SSL (Go 1.8)
run_on:
- ubuntu1404-test
expansions:
@@ -1727,6 +1722,7 @@ buildvariants:
<<: *mongo_ssl_startup_args
mongo_os: "ubuntu1404"
mongo_edition: "enterprise"
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go'
build_tags: "sasl ssl"
edition: ssl
arch: "linux/x86_64"
@@ -1737,7 +1733,7 @@ buildvariants:
tasks: *ubuntu1404_ssl_tasks
- name: ubuntu-enterprise
- display_name: Ubuntu 14.04 Enterprise
+ display_name: Ubuntu 14.04 Enterprise (Go 1.8)
run_on:
- ubuntu1404-test
expansions:
@@ -1745,6 +1741,7 @@ buildvariants:
<<: *mongo_default_startup_args
mongo_os: "ubuntu1404"
mongo_edition: "enterprise"
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go'
build_tags: "ssl sasl"
smoke_use_ssl: --use-ssl
resmoke_use_ssl: _ssl
@@ -1756,10 +1753,11 @@ buildvariants:
tasks: *ubuntu1404_enterprise_tasks
- name: ubuntu1604
- display_name: Ubuntu 16.04
+ display_name: Ubuntu 16.04 (Go 1.8)
run_on:
- ubuntu1604-test
expansions:
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go'
build_tags: "sasl ssl"
tasks:
- name: dist
@@ -1769,7 +1767,7 @@ buildvariants:
#######################################
- name: windows-64
- display_name: Windows 64-bit
+ display_name: Windows 64-bit (Go 1.8)
run_on:
- windows-64-vs2013-test
expansions:
@@ -1783,10 +1781,11 @@ buildvariants:
arch: "win32/x86_64"
preproc_gpm: "perl -pi -e 's/\\r\\n/\\n/g' "
integration_test_args: "integration"
+ gorootvars: 'PATH="/cygdrive/c/go1.8/go/bin:/cygdrive/c/mingw-w64/x86_64-4.9.1-posix-seh-rt_v3-rev1/mingw64/bin:$PATH" GOROOT="c:/go1.8/go"'
tasks: *windows_64_tasks
- name: windows-64-ssl
- display_name: Windows 64-bit SSL
+ display_name: Windows 64-bit SSL (Go 1.8)
run_on:
- windows-64-vs2013-compile
expansions:
@@ -1803,13 +1802,13 @@ buildvariants:
multiversion_override: "2.6"
extension: .exe
arch: "win32/x86_64"
- gorootvars: PATH="/cygdrive/c/mingw-w64/x86_64-4.9.1-posix-seh-rt_v3-rev1/mingw64/bin:/cygdrive/c/sasl/:$PATH"
+ gorootvars: 'PATH="/cygdrive/c/go1.8/go/bin:/cygdrive/c/mingw-w64/x86_64-4.9.1-posix-seh-rt_v3-rev1/mingw64/bin:$PATH" GOROOT="c:/go1.8/go"'
preproc_gpm: "perl -pi -e 's/\\r\\n/\\n/g' "
integration_test_args: "integration,ssl"
tasks: *windows_64_ssl_tasks
- name: windows-64-enterprise
- display_name: Windows 64-bit Enterprise
+ display_name: Windows 64-bit Enterprise (Go 1.8)
run_on:
- windows-64-vs2013-compile
expansions:
@@ -1827,19 +1826,49 @@ buildvariants:
edition: enterprise
extension: .exe
arch: "win32/x86_64"
- gorootvars: PATH="/cygdrive/c/mingw-w64/x86_64-4.9.1-posix-seh-rt_v3-rev1/mingw64/bin:/cygdrive/c/sasl/:$PATH"
+ gorootvars: 'PATH="/cygdrive/c/go1.8/go/bin:/cygdrive/c/mingw-w64/x86_64-4.9.1-posix-seh-rt_v3-rev1/mingw64/bin:$PATH" GOROOT="c:/go1.8/go"'
preproc_gpm: "perl -pi -e 's/\\r\\n/\\n/g' "
integration_test_args: "integration"
tasks: *windows_64_enterprise_tasks
#######################################
-# ZAP Buildvariants #
+# ARM Buildvariants #
+#######################################
+
+- name: ubuntu1604-arm64
+ display_name: ZAP ARM64 Ubuntu 16.04 SSL (gccgo 1.4)
+ run_on:
+ - ubuntu1604-arm64-small
+ stepback: false
+ batchtime: 10080 # weekly
+ expansions:
+ <<: *mongod_default_startup_args
+ <<: *mongo_default_startup_args
+ mongo_os: "ubuntu1604"
+ mongo_edition: "targeted"
+ mongo_arch: "arm64"
+ args: -gccgoflags "$(pkg-config --libs --cflags libcrypto libssl)"
+ build_tags: "ssl"
+ resmoke_use_ssl: _ssl
+ gorootvars: PATH="/opt/mongodbtoolchain/v2/bin/:$PATH"
+ excludes: requires_mmap_available,requires_large_ram,requires_mongo_24,requires_mongo_26,requires_mongo_30
+ resmoke_args: -j 2
+ multiversion_override: "skip"
+ arch: "linux/arm64"
+ edition: ssl
+ integration_test_args: integration
+ tasks: *ubuntu1604_ssl_tasks
+
+#######################################
+# Power Buildvariants #
#######################################
- name: rhel71-ppc64le-enterprise
- display_name: ZAP PPC64LE RHEL 7.1 Enterprise
+ display_name: ZAP PPC64LE RHEL 7.1 Enterprise (Go 1.8)
run_on:
- rhel71-power8-test
+ stepback: false
+ batchtime: 10080 # weekly
expansions:
<<: *mongod_default_startup_args
<<: *mongo_default_startup_args
@@ -1848,10 +1877,9 @@ buildvariants:
mongo_arch: "ppc64le"
# RHEL 7.1 PPC64LE machines kerberos setup does not work for mongo-tools
#args: ... libsasl2; build_tags "sasl ssl"
- args: -gccgoflags "$(pkg-config --libs --cflags libssl)"
build_tags: 'ssl'
resmoke_use_ssl: _ssl
- gorootvars: PATH="/opt/mongodbtoolchain/v2/bin/:$PATH"
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go CC=/opt/mongodbtoolchain/v2/bin/ppc64le-mongodb-linux-gcc'
resmoke_args: -j 4
excludes: requires_mmap_available,requires_large_ram,requires_mongo_24,requires_mongo_26,requires_mongo_30
multiversion_override: "skip"
@@ -1861,63 +1889,46 @@ buildvariants:
integration_test_args: integration
tasks: *rhel71_enterprise_tasks
-- name: rhel72-s390x-enterprise
- display_name: ZAP s390x RHEL 7.2 Enterprise
+- name: ubuntu1604-ppc64le-enterprise
+ display_name: ZAP PPC64LE Ubuntu 16.04 Enterprise (Go 1.8)
run_on:
- - rhel72-zseries-test
+ - ubuntu1604-power8-test
+ stepback: false
+ batchtime: 10080 # weekly
expansions:
- <<: *mongod_default_startup_args
- <<: *mongo_default_startup_args
- mongo_os: "rhel72"
- mongo_edition: "enterprise"
- mongo_arch: "s390x"
- args: -gccgoflags "$(pkg-config --libs --cflags libssl libsasl2)"
- build_tags: "sasl ssl"
- resmoke_use_ssl: _ssl
- gorootvars: PATH="/opt/mongodbtoolchain/v2/bin/:$PATH"
- excludes: requires_mmap_available,requires_mongo_24,requires_mongo_26,requires_mongo_30
- resmoke_args: -j 2
- multiversion_override: "skip"
- arch: "linux/s390x"
- edition: enterprise
- run_kinit: true
- integration_test_args: integration
- tasks: *rhel72_enterprise_tasks
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go CC=/opt/mongodbtoolchain/v2/bin/ppc64le-mongodb-linux-gcc'
+ build_tags: 'ssl sasl'
+ tasks:
+ - name: dist
+
+#######################################
+# Z (s390x) Buildvariants #
+#######################################
-- name: rhel72-s390x-enterprise-go1.7
- display_name: ZAP s390x RHEL 7.2 Enterprise (Go 1.7)
+- name: rhel67-s390x-enterprise
+ display_name: ZAP s390x RHEL 6.7 Enterprise (Go 1.8)
run_on:
- - rhel72-zseries-test
+ - rhel67-zseries-test
+ stepback: false
+ batchtime: 10080 # weekly
expansions:
- <<: *mongod_default_startup_args
- <<: *mongo_default_startup_args
- mongo_os: "rhel72"
- mongo_edition: "enterprise"
- mongo_arch: "s390x"
- args: -gccgoflags "$(pkg-config --libs --cflags libssl libsasl2)"
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go CC=/opt/mongodbtoolchain/v2/bin/s390x-mongodb-linux-gcc'
build_tags: "sasl ssl"
- resmoke_use_ssl: _ssl
- gorootvars: 'PATH="/opt/go1.7/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.7/go CC=/opt/mongodbtoolchain/v2/bin/s390x-mongodb-linux-gcc'
- excludes: requires_mmap_available,requires_mongo_24,requires_mongo_26,requires_mongo_30
- resmoke_args: -j 2
- multiversion_override: "skip"
- arch: "linux/s390x"
- edition: enterprise
- run_kinit: true
- integration_test_args: integration
- tasks: *rhel72_enterprise_tasks
+ tasks:
+ - name: dist
-- name: rhel72-s390x-enterprise-go1.8
+- name: rhel72-s390x-enterprise
display_name: ZAP s390x RHEL 7.2 Enterprise (Go 1.8)
run_on:
- rhel72-zseries-test
+ stepback: false
+ batchtime: 10080 # weekly
expansions:
<<: *mongod_default_startup_args
<<: *mongo_default_startup_args
mongo_os: "rhel72"
mongo_edition: "enterprise"
mongo_arch: "s390x"
- args: -gccgoflags "$(pkg-config --libs --cflags libssl libsasl2)"
build_tags: "sasl ssl"
resmoke_use_ssl: _ssl
gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go CC=/opt/mongodbtoolchain/v2/bin/s390x-mongodb-linux-gcc'
@@ -1930,27 +1941,29 @@ buildvariants:
integration_test_args: integration
tasks: *rhel72_enterprise_tasks
-- name: ubuntu1604-arm64
- display_name: ZAP ARM64 Ubuntu 16.04 SSL
+- name: suse12-s390x-enterprise
+ display_name: ZAP s390x SUSE 12 Enterprise (Go 1.8)
run_on:
- - ubuntu1604-arm64-small
+ - suse12-zseries-test
+ stepback: false
+ batchtime: 10080 # weekly
expansions:
- <<: *mongod_default_startup_args
- <<: *mongo_default_startup_args
- mongo_os: "ubuntu1604"
- mongo_edition: "targeted"
- mongo_arch: "arm64"
- args: -gccgoflags "$(pkg-config --libs --cflags libcrypto libssl)"
- build_tags: "ssl"
- resmoke_use_ssl: _ssl
- gorootvars: PATH="/opt/mongodbtoolchain/v2/bin/:$PATH"
- excludes: requires_mmap_available,requires_large_ram,requires_mongo_24,requires_mongo_26,requires_mongo_30
- resmoke_args: -j 2
- multiversion_override: "skip"
- arch: "linux/arm64"
- edition: ssl
- integration_test_args: integration
- tasks: *ubuntu1604_ssl_tasks
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go CC=/opt/mongodbtoolchain/v2/bin/s390x-mongodb-linux-gcc'
+ build_tags: "sasl ssl"
+ tasks:
+ - name: dist
+
+- name: ubuntu1604-s390x-enterprise
+ display_name: ZAP s390x Ubuntu 16.04 Enterprise (Go 1.8)
+ run_on:
+ - ubuntu1604-zseries-small
+ stepback: false
+ batchtime: 10080 # weekly
+ expansions:
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go CC=/opt/mongodbtoolchain/v2/bin/s390x-mongodb-linux-gcc'
+ build_tags: "sasl ssl"
+ tasks:
+ - name: dist
#######################################
# Experimental Buildvariants #
@@ -1959,7 +1972,7 @@ buildvariants:
- name: ubuntu-race
stepback: false
batchtime: 1440 # daily
- display_name: z Race Detector Ubuntu 14.04
+ display_name: z Race Detector Ubuntu 14.04 (Go 1.8)
run_on:
- ubuntu1404-test
expansions:
@@ -1967,6 +1980,7 @@ buildvariants:
<<: *mongo_default_startup_args
mongo_os: "ubuntu1404"
mongo_edition: "enterprise"
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go'
build_tags: "sasl ssl"
arch: "linux/x86_64"
args: "-race"
diff --git a/src/mongo/gotools/common/connstring/connstring.go b/src/mongo/gotools/common/connstring/connstring.go
index 8099ba95e59..503bf74bafd 100644
--- a/src/mongo/gotools/common/connstring/connstring.go
+++ b/src/mongo/gotools/common/connstring/connstring.go
@@ -58,6 +58,7 @@ type ConnString struct {
SocketTimeout time.Duration
Username string
UseSSL bool
+ UseSSLSeen bool
W string
WTimeout time.Duration
@@ -100,6 +101,7 @@ func (p *parser) parse(original string) error {
// SSL should be turned on by default when retrieving hosts from SRV
p.UseSSL = true
+ p.UseSSLSeen = true
// remove the scheme
uri = uri[14:]
@@ -428,6 +430,7 @@ func (p *parser) addOption(pair string) error {
return fmt.Errorf("invalid value for %s: %s", key, value)
}
p.UseSSL = b
+ p.UseSSLSeen = true
case "w":
p.W = value
case "wtimeoutms":
diff --git a/src/mongo/gotools/common/db/db_ssl.go b/src/mongo/gotools/common/db/db_openssl.go
index a36f7ce9df5..2a7106a068e 100644
--- a/src/mongo/gotools/common/db/db_ssl.go
+++ b/src/mongo/gotools/common/db/db_openssl.go
@@ -4,7 +4,7 @@
// 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
-// +build ssl
+// +build ssl,!openssl_pre_1.0
package db
diff --git a/src/mongo/gotools/common/db/db_tlsgo.go b/src/mongo/gotools/common/db/db_tlsgo.go
new file mode 100644
index 00000000000..6fa04a11a60
--- /dev/null
+++ b/src/mongo/gotools/common/db/db_tlsgo.go
@@ -0,0 +1,26 @@
+// Copyright (C) MongoDB, Inc. 2014-present.
+//
+// Licensed 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
+
+// +build ssl,openssl_pre_1.0
+
+package db
+
+import (
+ "github.com/mongodb/mongo-tools/common/db/tlsgo"
+ "github.com/mongodb/mongo-tools/common/options"
+)
+
+func init() {
+ GetConnectorFuncs = append(GetConnectorFuncs, getSSLConnector)
+}
+
+// return the SSL DB connector if using SSL, otherwise, return nil.
+func getSSLConnector(opts options.ToolOptions) DBConnector {
+ if opts.SSL.UseSSL {
+ return &tlsgo.TLSDBConnector{}
+ }
+ return nil
+}
diff --git a/src/mongo/gotools/common/db/openssl/openssl.go b/src/mongo/gotools/common/db/openssl/openssl.go
index ce98204ff7e..fc39c187f54 100644
--- a/src/mongo/gotools/common/db/openssl/openssl.go
+++ b/src/mongo/gotools/common/db/openssl/openssl.go
@@ -4,6 +4,8 @@
// 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
+// +build ssl,!openssl_pre_1.0
+
// Package openssl implements connection to MongoDB over ssl.
package openssl
diff --git a/src/mongo/gotools/common/db/openssl/openssl_fips.go b/src/mongo/gotools/common/db/openssl/openssl_fips.go
index eb7fc5ff7e6..08a0f644cb8 100644
--- a/src/mongo/gotools/common/db/openssl/openssl_fips.go
+++ b/src/mongo/gotools/common/db/openssl/openssl_fips.go
@@ -4,7 +4,7 @@
// 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
-// +build ssl
+// +build ssl,!openssl_pre_1.0
package openssl
diff --git a/src/mongo/gotools/common/db/tlsgo/config.go b/src/mongo/gotools/common/db/tlsgo/config.go
new file mode 100644
index 00000000000..557436da830
--- /dev/null
+++ b/src/mongo/gotools/common/db/tlsgo/config.go
@@ -0,0 +1,242 @@
+// Copyright (C) MongoDB, Inc. 2018-present.
+//
+// Licensed 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
+
+// This file contains code adapted from the MongoDB Go Driver.
+
+// Package tlsgo provides a mgo connection using Go's native TLS library.
+package tlsgo
+
+import (
+ "crypto/tls"
+ "crypto/x509"
+ "encoding/asn1"
+ "encoding/hex"
+ "encoding/pem"
+ "fmt"
+ "io/ioutil"
+ "strings"
+)
+
+// TLSConfig contains options for configuring an SSL connection to the server.
+type TLSConfig struct {
+ caCert *x509.Certificate
+ clientCert *tls.Certificate
+ insecure bool
+}
+
+// NewTLSConfig creates a new TLSConfig.
+func NewTLSConfig() *TLSConfig {
+ cfg := &TLSConfig{}
+
+ return cfg
+}
+
+// SetInsecure sets whether the client should verify the server's certificate chain and hostnames.
+func (c *TLSConfig) SetInsecure(allow bool) {
+ c.insecure = allow
+}
+
+// AddClientCertFromFile adds a client certificate to the configuration given a path to the
+// containing file and returns the certificate's subject name.
+func (c *TLSConfig) AddClientCertFromFile(clientFile, password string) (string, error) {
+ data, err := ioutil.ReadFile(clientFile)
+ if err != nil {
+ return "", err
+ }
+
+ certPEM, err := loadPEMBlock(data, "CERTIFICATE")
+ if err != nil {
+ return "", err
+ }
+
+ keyPEM, err := loadPEMBlock(data, "PRIVATE KEY")
+ if err != nil {
+ return "", err
+ }
+ if x509.IsEncryptedPEMBlock(keyPEM) {
+ if password == "" {
+ return "", fmt.Errorf("No password provided to decrypt private key")
+ }
+ decrypted, err := x509.DecryptPEMBlock(keyPEM, []byte(password))
+ if err != nil {
+ return "", err
+ }
+ keyPEM, err = loadPEMBlock(decrypted, "PRIVATE KEY")
+ if err != nil {
+ return "", err
+ }
+ }
+
+ cert, err := tls.X509KeyPair(pem.EncodeToMemory(certPEM), pem.EncodeToMemory(keyPEM))
+ if err != nil {
+ return "", err
+ }
+
+ c.clientCert = &cert
+
+ // The documentation for the tls.X509KeyPair indicates that the Leaf
+ // certificate is not retained. Because there isn't any way of creating a
+ // tls.Certificate from an x509.Certificate short of calling X509KeyPair
+ // on the raw bytes, we're forced to parse the certificate over again to
+ // get the subject name.
+ crt, err := x509.ParseCertificate(certPEM.Bytes)
+ if err != nil {
+ return "", err
+ }
+
+ return x509CertSubject(crt), nil
+}
+
+// AddCaCertFromFile adds a root CA certificate to the configuration given a path to the containing file.
+func (c *TLSConfig) AddCaCertFromFile(caFile string) error {
+ data, err := ioutil.ReadFile(caFile)
+ if err != nil {
+ return err
+ }
+
+ certBytes, err := loadCertBytes(data)
+ if err != nil {
+ return err
+ }
+
+ cert, err := x509.ParseCertificate(certBytes)
+ if err != nil {
+ return err
+ }
+
+ c.caCert = cert
+
+ return nil
+}
+
+// MakeConfig constructs a new tls.Config from the configuration specified.
+func (c *TLSConfig) MakeConfig() (*tls.Config, error) {
+ cfg := &tls.Config{}
+
+ if c.clientCert != nil {
+ cfg.Certificates = []tls.Certificate{*c.clientCert}
+ }
+
+ if c.caCert == nil {
+ roots, err := loadSystemCAs()
+ if err != nil {
+ return nil, err
+ }
+ cfg.RootCAs = roots
+ } else {
+ cfg.RootCAs = x509.NewCertPool()
+ cfg.RootCAs.AddCert(c.caCert)
+ }
+
+ cfg.InsecureSkipVerify = c.insecure
+
+ return cfg, nil
+}
+
+func loadCertBytes(data []byte) ([]byte, error) {
+ b, err := loadPEMBlock(data, "CERTIFICATE")
+ if err != nil {
+ return nil, err
+ }
+ return b.Bytes, nil
+}
+
+func loadPEMBlock(data []byte, blocktype string) (*pem.Block, error) {
+ var b *pem.Block
+
+ for b == nil {
+ if data == nil || len(data) == 0 {
+ return nil, fmt.Errorf("no block of type %s found in .pem file", blocktype)
+ }
+
+ block, rest := pem.Decode(data)
+ if block == nil {
+ return nil, fmt.Errorf("invalid .pem file")
+ }
+
+ if strings.Contains(block.Type, blocktype) {
+ if b != nil {
+ return nil, fmt.Errorf("multiple %s sections in .pem file", blocktype)
+ }
+ b = block
+ }
+
+ data = rest
+ }
+
+ return b, nil
+}
+
+// Because the functionality to convert a pkix.Name to a string wasn't added until Go 1.10, we
+// need to copy the implementation (along with the attributeTypeNames map below).
+func x509CertSubject(cert *x509.Certificate) string {
+ r := cert.Subject.ToRDNSequence()
+
+ s := ""
+ for i := 0; i < len(r); i++ {
+ rdn := r[len(r)-1-i]
+ if i > 0 {
+ s += ","
+ }
+ for j, tv := range rdn {
+ if j > 0 {
+ s += "+"
+ }
+
+ oidString := tv.Type.String()
+ typeName, ok := attributeTypeNames[oidString]
+ if !ok {
+ derBytes, err := asn1.Marshal(tv.Value)
+ if err == nil {
+ s += oidString + "=#" + hex.EncodeToString(derBytes)
+ continue // No value escaping necessary.
+ }
+
+ typeName = oidString
+ }
+
+ valueString := fmt.Sprint(tv.Value)
+ escaped := make([]rune, 0, len(valueString))
+
+ for k, c := range valueString {
+ escape := false
+
+ switch c {
+ case ',', '+', '"', '\\', '<', '>', ';':
+ escape = true
+
+ case ' ':
+ escape = k == 0 || k == len(valueString)-1
+
+ case '#':
+ escape = k == 0
+ }
+
+ if escape {
+ escaped = append(escaped, '\\', c)
+ } else {
+ escaped = append(escaped, c)
+ }
+ }
+
+ s += typeName + "=" + string(escaped)
+ }
+ }
+
+ return s
+}
+
+var attributeTypeNames = map[string]string{
+ "2.5.4.6": "C",
+ "2.5.4.10": "O",
+ "2.5.4.11": "OU",
+ "2.5.4.3": "CN",
+ "2.5.4.5": "SERIALNUMBER",
+ "2.5.4.7": "L",
+ "2.5.4.8": "ST",
+ "2.5.4.9": "STREET",
+ "2.5.4.17": "POSTALCODE",
+}
diff --git a/src/mongo/gotools/common/db/tlsgo/rootcerts.go b/src/mongo/gotools/common/db/tlsgo/rootcerts.go
new file mode 100644
index 00000000000..34abc4b1c88
--- /dev/null
+++ b/src/mongo/gotools/common/db/tlsgo/rootcerts.go
@@ -0,0 +1,22 @@
+// Copyright (C) MongoDB, Inc. 2018-present.
+//
+// Licensed 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
+//
+// Based on https://github.com/hashicorp/go-rootcerts by HashiCorp
+// See THIRD-PARTY-NOTICES for original license terms.
+
+// +build ssl,openssl_pre_1.0,!darwin
+
+package tlsgo
+
+import (
+ "crypto/x509"
+)
+
+// Stubbed for non-darwin systems. By returning nil, the Go library
+// will use its own code for finding system certs.
+func loadSystemCAs() (*x509.CertPool, error) {
+ return nil, nil
+}
diff --git a/src/mongo/gotools/common/db/tlsgo/rootcerts_darwin.go b/src/mongo/gotools/common/db/tlsgo/rootcerts_darwin.go
new file mode 100644
index 00000000000..7f3084032e0
--- /dev/null
+++ b/src/mongo/gotools/common/db/tlsgo/rootcerts_darwin.go
@@ -0,0 +1,60 @@
+// Copyright (C) MongoDB, Inc. 2018-present.
+//
+// Licensed 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
+//
+// Based on https://github.com/hashicorp/go-rootcerts by HashiCorp
+// See THIRD-PARTY-NOTICES for original license terms.
+
+// +build ssl,openssl_pre_1.0
+
+package tlsgo
+
+import (
+ "crypto/x509"
+ "os/exec"
+ "os/user"
+ "path"
+)
+
+// loadSystemCAs has special behavior on Darwin systems to work around
+// bugs loading certs from keychains. See this GitHub issues query:
+// https://github.com/golang/go/issues?utf8=%E2%9C%93&q=is%3Aissue+darwin+keychain
+func loadSystemCAs() (*x509.CertPool, error) {
+ pool := x509.NewCertPool()
+
+ for _, keychain := range certKeychains() {
+ err := addCertsFromKeychain(pool, keychain)
+ if err != nil {
+ return nil, err
+ }
+ }
+
+ return pool, nil
+}
+
+func addCertsFromKeychain(pool *x509.CertPool, keychain string) error {
+ cmd := exec.Command("/usr/bin/security", "find-certificate", "-a", "-p", keychain)
+ data, err := cmd.Output()
+ if err != nil {
+ return err
+ }
+
+ pool.AppendCertsFromPEM(data)
+
+ return nil
+}
+
+func certKeychains() []string {
+ keychains := []string{
+ "/System/Library/Keychains/SystemRootCertificates.keychain",
+ "/Library/Keychains/System.keychain",
+ }
+ user, err := user.Current()
+ if err == nil {
+ loginKeychain := path.Join(user.HomeDir, "Library", "Keychains", "login.keychain")
+ keychains = append(keychains, loginKeychain)
+ }
+ return keychains
+}
diff --git a/src/mongo/gotools/common/db/tlsgo/tlsgo.go b/src/mongo/gotools/common/db/tlsgo/tlsgo.go
new file mode 100644
index 00000000000..c26b7e2dc4f
--- /dev/null
+++ b/src/mongo/gotools/common/db/tlsgo/tlsgo.go
@@ -0,0 +1,135 @@
+// Copyright (C) MongoDB, Inc. 2014-present.
+//
+// Licensed 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
+
+// Package tlsgo implements connection to MongoDB with Go native TLS.
+package tlsgo
+
+import (
+ "crypto/tls"
+ "fmt"
+ "net"
+ "strings"
+ "time"
+
+ "github.com/mongodb/mongo-tools/common/db/kerberos"
+ "github.com/mongodb/mongo-tools/common/log"
+ "github.com/mongodb/mongo-tools/common/options"
+ "github.com/mongodb/mongo-tools/common/util"
+ "gopkg.in/mgo.v2"
+)
+
+// TLSDBConnector makes a connection to the database with Go native TLS.
+type TLSDBConnector struct {
+ dialInfo *mgo.DialInfo
+ config *TLSConfig
+}
+
+// Configure the connector to connect to the server over ssl. Sets up the
+// correct function to dial the server based on the ssl options passed in.
+func (c *TLSDBConnector) Configure(opts options.ToolOptions) error {
+ if opts.SSLFipsMode {
+ return fmt.Errorf("FIPS mode not supported")
+ }
+
+ if opts.SSLCRLFile != "" {
+ return fmt.Errorf("CRL files are not supported on this platform")
+ }
+
+ c.config = NewTLSConfig()
+
+ if opts.SSLAllowInvalidCert || opts.SSLAllowInvalidHost {
+ c.config.SetInsecure(true)
+ }
+
+ if opts.SSLPEMKeyFile != "" {
+ subject, err := c.config.AddClientCertFromFile(opts.SSLPEMKeyFile, opts.SSLPEMKeyPassword)
+ if err != nil {
+ return err
+ }
+ if opts.Auth.Mechanism == "MONGODB-X509" && opts.Auth.Username == "" {
+ opts.Auth.Username = subject
+ }
+ }
+
+ if opts.SSLCAFile != "" {
+ c.config.AddCaCertFromFile(opts.SSLCAFile)
+ }
+
+ // set up the dial info
+ c.dialInfo = &mgo.DialInfo{
+ Timeout: time.Duration(opts.Timeout) * time.Second,
+ Direct: opts.Direct,
+ ReplicaSetName: opts.ReplicaSetName,
+ DialServer: c.makeDialer(opts),
+ Username: opts.Auth.Username,
+ Password: opts.Auth.Password,
+ Source: opts.GetAuthenticationDatabase(),
+ Mechanism: opts.Auth.Mechanism,
+ }
+
+ // create or fetch the addresses to be used to connect
+ if opts.URI != nil && opts.URI.ConnectionString != "" {
+ c.dialInfo.Addrs = opts.URI.GetConnectionAddrs()
+ } else {
+ c.dialInfo.Addrs = util.CreateConnectionAddrs(opts.Host, opts.Port)
+ }
+ kerberos.AddKerberosOpts(opts, c.dialInfo)
+ return nil
+}
+
+// GetNewSession dials the server.
+func (c *TLSDBConnector) GetNewSession() (*mgo.Session, error) {
+ return mgo.DialWithInfo(c.dialInfo)
+}
+
+// To be handed to mgo.DialInfo for connecting to the server.
+type dialerFunc func(addr *mgo.ServerAddr) (net.Conn, error)
+
+func (c *TLSDBConnector) makeDialer(opts options.ToolOptions) dialerFunc {
+ return func(addr *mgo.ServerAddr) (net.Conn, error) {
+ address := addr.String()
+ conn, err := net.Dial("tcp", address)
+ if err != nil {
+ // mgo discards dialer errors so log it now
+ log.Logvf(log.Always, "error dialing %v: %v", address, err)
+ return nil, err
+ }
+ // enable TCP keepalive
+ err = util.EnableTCPKeepAlive(conn, time.Duration(opts.TCPKeepAliveSeconds)*time.Second)
+ if err != nil {
+ // mgo discards dialer errors so log it now
+ log.Logvf(log.Always, "error enabling TCP keepalive on connection to %v: %v", address, err)
+ conn.Close()
+ return nil, err
+ }
+
+ tlsConfig, err := c.config.MakeConfig()
+ if err != nil {
+ return nil, err
+ }
+
+ if !tlsConfig.InsecureSkipVerify {
+ colonPos := strings.LastIndex(address, ":")
+ if colonPos == -1 {
+ colonPos = len(address)
+ }
+
+ hostname := address[:colonPos]
+ tlsConfig.ServerName = hostname
+ }
+
+ client := tls.Client(conn, tlsConfig)
+ err = client.Handshake()
+ if err != nil {
+ // mgo discards dialer errors so log it now
+ log.Logvf(log.Always, "error doing TLS handshake with %v: %v", address, err)
+ client.Close()
+ return nil, err
+ }
+
+ return client, nil
+ }
+}
diff --git a/src/mongo/gotools/common/options/options.go b/src/mongo/gotools/common/options/options.go
index a146f754dbe..90052cd3205 100644
--- a/src/mongo/gotools/common/options/options.go
+++ b/src/mongo/gotools/common/options/options.go
@@ -10,17 +10,18 @@ package options
import (
"fmt"
- "github.com/jessevdk/go-flags"
- "github.com/mongodb/mongo-tools/common/connstring"
- "github.com/mongodb/mongo-tools/common/failpoint"
- "github.com/mongodb/mongo-tools/common/log"
- "github.com/mongodb/mongo-tools/common/util"
"os"
"regexp"
"runtime"
"strconv"
"strings"
"time"
+
+ "github.com/jessevdk/go-flags"
+ "github.com/mongodb/mongo-tools/common/connstring"
+ "github.com/mongodb/mongo-tools/common/failpoint"
+ "github.com/mongodb/mongo-tools/common/log"
+ "github.com/mongodb/mongo-tools/common/util"
)
// Gitspec that the tool was built with. Needs to be set using -ldflags
@@ -45,6 +46,7 @@ var (
)
const IncompatibleArgsErrorFormat = "illegal argument combination: cannot specify %s and --uri"
+const ConflictingArgsErrorFormat = "illegal argument combination: %s conflicts with --uri"
// Struct encompassing all of the options that are reused across tools: "help",
// "version", verbosity settings, ssl settings, etc.
@@ -506,7 +508,12 @@ func (opts *ToolOptions) setOptionsFromURI(cs connstring.ConnString) error {
}
return fmt.Errorf("cannot use ssl: tool not built with SSL support")
}
- opts.SSL.UseSSL = cs.UseSSL
+ if cs.UseSSLSeen {
+ if opts.SSL.UseSSL && !cs.UseSSL {
+ return fmt.Errorf(ConflictingArgsErrorFormat, "--ssl")
+ }
+ opts.SSL.UseSSL = cs.UseSSL
+ }
if cs.KerberosService != "" && !BuiltWithGSSAPI {
return fmt.Errorf("cannot specify gssapiservicename: tool not built with kerberos support")
diff --git a/src/mongo/gotools/common/options/options_openssl.go b/src/mongo/gotools/common/options/options_openssl.go
new file mode 100644
index 00000000000..afb18ab8eb2
--- /dev/null
+++ b/src/mongo/gotools/common/options/options_openssl.go
@@ -0,0 +1,18 @@
+// Copyright (C) MongoDB, Inc. 2014-present.
+//
+// Licensed 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
+
+// +build ssl,!openssl_pre_1.0
+
+package options
+
+import "github.com/10gen/openssl"
+
+func init() {
+ versionInfos = append(versionInfos, versionInfo{
+ key: "OpenSSL version",
+ value: openssl.Version,
+ })
+}
diff --git a/src/mongo/gotools/common/options/options_ssl.go b/src/mongo/gotools/common/options/options_ssl.go
index e65f7e81cce..de11cf9686a 100644
--- a/src/mongo/gotools/common/options/options_ssl.go
+++ b/src/mongo/gotools/common/options/options_ssl.go
@@ -8,14 +8,8 @@
package options
-import "github.com/10gen/openssl"
-
func init() {
ConnectionOptFunctions = append(ConnectionOptFunctions, registerSSLOptions)
- versionInfos = append(versionInfos, versionInfo{
- key: "OpenSSL version",
- value: openssl.Version,
- })
}
func registerSSLOptions(self *ToolOptions) error {
diff --git a/src/mongo/gotools/common/options/options_test.go b/src/mongo/gotools/common/options/options_test.go
index 651588c29dc..fbf603c8947 100644
--- a/src/mongo/gotools/common/options/options_test.go
+++ b/src/mongo/gotools/common/options/options_test.go
@@ -102,7 +102,8 @@ func TestParseAndSetOptions(t *testing.T) {
{
Name: "not built with ssl",
CS: connstring.ConnString{
- UseSSL: true,
+ UseSSL: true,
+ UseSSLSeen: true,
},
WithSSL: false,
OptsIn: New("", "", enabledURIOnly),
@@ -112,8 +113,9 @@ func TestParseAndSetOptions(t *testing.T) {
{
Name: "not built with ssl using SRV",
CS: connstring.ConnString{
- UseSSL: true,
- UsingSRV: true,
+ UseSSL: true,
+ UseSSLSeen: true,
+ UsingSRV: true,
},
WithSSL: false,
OptsIn: New("", "", enabledURIOnly),
@@ -123,7 +125,8 @@ func TestParseAndSetOptions(t *testing.T) {
{
Name: "built with ssl",
CS: connstring.ConnString{
- UseSSL: true,
+ UseSSL: true,
+ UseSSLSeen: true,
},
WithSSL: true,
OptsIn: New("", "", enabledURIOnly),
@@ -145,8 +148,9 @@ func TestParseAndSetOptions(t *testing.T) {
{
Name: "built with ssl using SRV",
CS: connstring.ConnString{
- UseSSL: true,
- UsingSRV: true,
+ UseSSL: true,
+ UseSSLSeen: true,
+ UsingSRV: true,
},
WithSSL: true,
OptsIn: New("", "", enabledURIOnly),
diff --git a/src/mongo/gotools/import.data b/src/mongo/gotools/import.data
index 9ddca3dee8b..d6c5b324efc 100644
--- a/src/mongo/gotools/import.data
+++ b/src/mongo/gotools/import.data
@@ -1,5 +1,5 @@
{
- "commit": "636c8d0a8e320b345c74d700b1228fd7b2cc7efc",
+ "commit": "f5c4a44d3242b97eff9764e1456fe05c1fb6a5b5",
"github": "mongodb/mongo-tools.git",
"vendor": "tools",
"branch": "master"
diff --git a/src/mongo/gotools/test.sh b/src/mongo/gotools/test.sh
index 6ea8bafebab..c90e404c1cb 100755
--- a/src/mongo/gotools/test.sh
+++ b/src/mongo/gotools/test.sh
@@ -20,9 +20,9 @@ rm -rf vendor/pkg
. ./set_gopath.sh
mkdir -p bin
-for i in bsondump mongostat mongofiles mongoexport mongoimport mongorestore mongodump mongotop mongoreplay; do
+for i in common bsondump mongostat mongofiles mongoexport mongoimport mongorestore mongodump mongotop mongoreplay; do
echo "Testing ${i}..."
- (cd $i && go test)
+ (cd $i && go test ./... -tags "${tags}")
done
mv -f common/options/options.go.bak common/options/options.go
diff --git a/src/mongo/gotools/vendor/src/github.com/10gen/openssl/.evergreen/config.yml b/src/mongo/gotools/vendor/src/github.com/10gen/openssl/.evergreen/config.yml
index 4b2e7c348fc..b8bbabba9a9 100644
--- a/src/mongo/gotools/vendor/src/github.com/10gen/openssl/.evergreen/config.yml
+++ b/src/mongo/gotools/vendor/src/github.com/10gen/openssl/.evergreen/config.yml
@@ -107,11 +107,22 @@ buildvariants:
#######################################
- name: amazonlinux64
- display_name: Amazon Linux 64
+ display_name: Amazon Linux 64 (Go 1.8)
run_on:
- linux-64-amzn-test
expansions:
- gorootvars: ""
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go'
+ build_tags: ""
+ tasks:
+ - name: build
+ - name: test
+
+- name: amazon2
+ display_name: Amazon Linux 64 v2 (Go 1.8)
+ run_on:
+ - amazon2-test
+ expansions:
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go'
build_tags: ""
tasks:
- name: build
@@ -122,33 +133,33 @@ buildvariants:
#######################################
- name: debian71
- display_name: Debian 7.1
+ display_name: Debian 7.1 (Go 1.8)
run_on:
- debian71-test
expansions:
- gorootvars: PATH="/opt/go/bin:$PATH"
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go'
build_tags: ""
tasks:
- name: build
- name: test
- name: debian81
- display_name: Debian 8.1
+ display_name: Debian 8.1 (Go 1.8)
run_on:
- debian81-test
expansions:
- gorootvars: PATH="/opt/go/bin:$PATH"
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go'
build_tags: ""
tasks:
- name: build
- name: test
- name: debian92
- display_name: Debian 9.2
+ display_name: Debian 9.2 (Go 1.8)
run_on:
- debian92-test
expansions:
- gorootvars: PATH="/opt/go/bin:$PATH"
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go'
build_tags: ""
tasks:
- name: build
@@ -159,11 +170,11 @@ buildvariants:
#######################################
- name: macOS-1012
- display_name: MacOS 10.12
+ display_name: MacOS 10.12 (Go 1.8)
run_on:
- macos-1012
expansions:
- gorootvars: CGO_CPPFLAGS=-I/opt/mongodbtoolchain/v2/include CGO_CFLAGS=-mmacosx-version-min=10.10 CGO_LDFLAGS=-mmacosx-version-min=10.10
+ gorootvars: 'PATH="/usr/local/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/usr/local/go1.8/go CGO_CPPFLAGS=-I/opt/mongodbtoolchain/v2/include CGO_CFLAGS=-mmacosx-version-min=10.10 CGO_LDFLAGS=-mmacosx-version-min=10.10'
build_tags: "openssl_pre_1.0"
tasks:
- name: build
@@ -174,22 +185,22 @@ buildvariants:
#######################################
- name: rhel62
- display_name: RHEL 6.2
+ display_name: RHEL 6.2 (Go 1.8)
run_on:
- rhel62-test
expansions:
- gorootvars: PATH="/opt/go/bin:$PATH"
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go'
build_tags: ""
tasks:
- name: build
- name: test
- name: rhel70
- display_name: RHEL 7.0
+ display_name: RHEL 7.0 (Go 1.8)
run_on:
- rhel70
expansions:
- gorootvars: PATH="/opt/go/bin:$PATH"
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go'
build_tags: ""
tasks:
- name: build
@@ -200,22 +211,22 @@ buildvariants:
#######################################
- name: suse11
- display_name: SUSE 11
+ display_name: SUSE 11 (Go 1.8)
run_on:
- suse11-test
expansions:
- gorootvars: ""
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go'
build_tags: "openssl_pre_1.0"
tasks:
- name: build
- name: test
- name: suse12
- display_name: SUSE 12
+ display_name: SUSE 12 (Go 1.8)
run_on:
- suse12-test
expansions:
- gorootvars: ""
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go'
build_tags: ""
tasks:
- name: build
@@ -225,66 +236,102 @@ buildvariants:
# Ubuntu Buildvariants #
#######################################
-- name: ubuntu1204
- display_name: Ubuntu 12.04
+- name: ubuntu1404
+ display_name: Ubuntu 14.04 (Go 1.8)
run_on:
- - ubuntu1204-test
+ - ubuntu1404-test
expansions:
- gorootvars: ""
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go'
build_tags: ""
tasks:
- name: build
- name: test
-- name: ubuntu1404
- display_name: Ubuntu 14.04
+- name: ubuntu1604
+ display_name: Ubuntu 16.04 (Go 1.8)
run_on:
- - ubuntu1404-test
+ - ubuntu1604-test
expansions:
- gorootvars: ""
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go'
build_tags: ""
tasks:
- name: build
- name: test
-- name: ubuntu1604
- display_name: Ubuntu 16.04
+#######################################
+# Windows Buildvariants #
+#######################################
+
+- name: windows-64
+ display_name: Windows 64-bit (Go 1.8)
run_on:
- - ubuntu1604-test
+ - windows-64-vs2015-test
expansions:
- gorootvars: ""
+ gorootvars: 'PATH="/cygdrive/c/go1.8/go/bin:/cygdrive/c/mingw-w64/x86_64-4.9.1-posix-seh-rt_v3-rev1/mingw64/bin:$PATH" GOROOT="c:/go1.8/go"'
build_tags: ""
tasks:
- name: build
- name: test
#######################################
-# Windows Buildvariants #
+# ARM Buildvariants #
#######################################
-- name: windows-64
- display_name: Windows 64-bit
+- name: ubuntu1604-arm64-go1.8
+ display_name: ZAP ARM64 Ubuntu 16.04 SSL (Go 1.8)
run_on:
- - windows-64-vs2013-test
+ - ubuntu1604-arm64-small
+ stepback: false
+ batchtime: 604800
expansions:
- gorootvars: PATH="/cygdrive/c/mingw-w64/x86_64-4.9.1-posix-seh-rt_v3-rev1/mingw64/bin:$PATH"
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go CC=/opt/mongodbtoolchain/v2/bin/aarch64-mongodb-linux-gcc'
build_tags: ""
tasks:
- name: build
- name: test
#######################################
-# ZAP Buildvariants #
+# Power Buildvariants #
#######################################
-- name: rhel71-ppc64le-enterprise
- display_name: ZAP PPC64LE RHEL 7.1 Enterprise
+- name: rhel71-ppc64le-enterprise-go1.8
+ display_name: ZAP PPC64LE RHEL 7.1 Enterprise (Go 1.8)
run_on:
- rhel71-power8-test
stepback: false
batchtime: 604800
expansions:
- gorootvars: PATH="/opt/mongodbtoolchain/v2/bin/:$PATH"
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go CC=/opt/mongodbtoolchain/v2/bin/ppc64le-mongodb-linux-gcc'
+ build_tags: ""
+ tasks:
+ - name: build
+ - name: test
+
+- name: ubuntu1604-ppc64le-enterprise-go1.8
+ display_name: ZAP PPC64LE Ubuntu 16.04 Enterprise (Go 1.8)
+ run_on:
+ - ubuntu1604-power8-test
+ stepback: false
+ batchtime: 604800
+ expansions:
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go CC=/opt/mongodbtoolchain/v2/bin/ppc64le-mongodb-linux-gcc'
+ build_tags: ""
+ tasks:
+ - name: build
+ - name: test
+
+#######################################
+# Z (s390x) Buildvariants #
+#######################################
+
+- name: rhel67-s390x-enterprise-go1.8
+ display_name: ZAP s390x RHEL 6.7 Enterprise (Go 1.8)
+ run_on:
+ - rhel67-zseries-test
+ stepback: false
+ batchtime: 604800
+ expansions:
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go CC=/opt/mongodbtoolchain/v2/bin/s390x-mongodb-linux-gcc'
build_tags: ""
tasks:
- name: build
@@ -303,27 +350,27 @@ buildvariants:
- name: build
- name: test
-- name: rhel72-s390x-enterprise-go1.7
- display_name: ZAP s390x RHEL 7.2 Enterprise (Go 1.7)
+- name: suse12-s390x-enterprise-go1.8
+ display_name: ZAP s390x SUSE 12 Enterprise (Go 1.8)
run_on:
- - rhel72-zseries-test
+ - suse12-zseries-test
stepback: false
batchtime: 604800
expansions:
- gorootvars: 'PATH="/opt/go1.7/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.7/go CC=/opt/mongodbtoolchain/v2/bin/s390x-mongodb-linux-gcc'
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go CC=/opt/mongodbtoolchain/v2/bin/s390x-mongodb-linux-gcc'
build_tags: ""
tasks:
- name: build
- name: test
-- name: ubuntu1604-arm64
- display_name: ZAP ARM64 Ubuntu 16.04 SSL
+- name: ubuntu1604-s390x-enterprise-go1.8
+ display_name: ZAP s390x Ubuntu 16.04 Enterprise (Go 1.8)
run_on:
- - ubuntu1604-arm64-small
+ - ubuntu1604-zseries-small
stepback: false
batchtime: 604800
expansions:
- gorootvars: PATH="/opt/mongodbtoolchain/v2/bin/:$PATH"
+ gorootvars: 'PATH="/opt/go1.8/go/bin:/opt/mongodbtoolchain/v2/bin/:$PATH" GOROOT=/opt/go1.8/go CC=/opt/mongodbtoolchain/v2/bin/s390x-mongodb-linux-gcc'
build_tags: ""
tasks:
- name: build
diff --git a/src/mongo/gotools/vendor/src/github.com/10gen/openssl/ctx.go b/src/mongo/gotools/vendor/src/github.com/10gen/openssl/ctx.go
index a092c3aae72..f67a95d6ea3 100644
--- a/src/mongo/gotools/vendor/src/github.com/10gen/openssl/ctx.go
+++ b/src/mongo/gotools/vendor/src/github.com/10gen/openssl/ctx.go
@@ -100,6 +100,12 @@ func NewCtxWithVersion(version SSLVersion) (*Ctx, error) {
switch version {
case SSLv3:
method = C.X_SSLv3_method()
+ case TLSv1:
+ method = C.X_TLSv1_method()
+ case TLSv1_1:
+ method = C.X_TLSv1_1_method()
+ case TLSv1_2:
+ method = C.X_TLSv1_2_method()
case AnyVersion:
method = C.X_SSLv23_method()
}
@@ -550,10 +556,13 @@ type Options uint
const (
// NoCompression is only valid if you are using OpenSSL 1.0.1 or newer
- NoCompression Options = C.SSL_OP_NO_COMPRESSION
- NoSSLv2 Options = C.SSL_OP_NO_SSLv2
- NoSSLv3 Options = C.SSL_OP_NO_SSLv3
- NoTLSv1 Options = C.SSL_OP_NO_TLSv1
+ NoCompression Options = C.SSL_OP_NO_COMPRESSION
+ NoSSLv2 Options = C.SSL_OP_NO_SSLv2
+ NoSSLv3 Options = C.SSL_OP_NO_SSLv3
+ NoTLSv1 Options = C.SSL_OP_NO_TLSv1
+ // NoTLSv1_1 and NoTLSv1_2 are only valid if you are using OpenSSL 1.0.1 or newer
+ NoTLSv1_1 Options = C.SSL_OP_NO_TLSv1_1
+ NoTLSv1_2 Options = C.SSL_OP_NO_TLSv1_2
CipherServerPreference Options = C.SSL_OP_CIPHER_SERVER_PREFERENCE
NoSessionResumptionOrRenegotiation Options = C.SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION
NoTicket Options = C.SSL_OP_NO_TICKET
diff --git a/src/mongo/gotools/vendor/src/github.com/10gen/openssl/shim.c b/src/mongo/gotools/vendor/src/github.com/10gen/openssl/shim.c
index 26765043af9..bb3239b0571 100644
--- a/src/mongo/gotools/vendor/src/github.com/10gen/openssl/shim.c
+++ b/src/mongo/gotools/vendor/src/github.com/10gen/openssl/shim.c
@@ -409,9 +409,8 @@ const SSL_METHOD *X_TLSv1_method() {
return TLSv1_method();
}
-/*
const SSL_METHOD *X_TLSv1_1_method() {
-#if defined(TLS1_1_VERSION) && !defined(OPENSSL_SYSNAME_MACOSX)
+#if OPENSSL_VERSION_NUMBER > 0x10000000L
return TLSv1_1_method();
#else
return NULL;
@@ -419,14 +418,13 @@ const SSL_METHOD *X_TLSv1_1_method() {
}
const SSL_METHOD *X_TLSv1_2_method() {
-#if defined(TLS1_2_VERSION) && !defined(OPENSSL_SYSNAME_MACOSX)
+#if OPENSSL_VERSION_NUMBER > 0x10000000L
return TLSv1_2_method();
#else
return NULL;
#endif
}
-*/
int X_SSL_CTX_new_index() {
return SSL_CTX_get_ex_new_index(0, NULL, NULL, NULL, NULL);
}
diff --git a/src/mongo/gotools/vendor/src/github.com/10gen/openssl/shim.h b/src/mongo/gotools/vendor/src/github.com/10gen/openssl/shim.h
index ecb71a74486..1e9ddebe8ab 100644
--- a/src/mongo/gotools/vendor/src/github.com/10gen/openssl/shim.h
+++ b/src/mongo/gotools/vendor/src/github.com/10gen/openssl/shim.h
@@ -40,6 +40,14 @@
#define SSL_OP_NO_COMPRESSION 0
#endif
+#ifndef SSL_OP_NO_TLSv1_1
+#define SSL_OP_NO_TLSv1_1 0
+#endif
+
+#ifndef SSL_OP_NO_TLSv1_2
+#define SSL_OP_NO_TLSv1_2 0
+#endif
+
/* shim methods */
extern int X_shim_init();