Skip to content

Commit 82a3c89

Browse files
committed
chore: restore integration.ps1
1 parent e6eb83b commit 82a3c89

File tree

3 files changed

+25
-69
lines changed

3 files changed

+25
-69
lines changed

bazel/curl.BUILD

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ CURL_WIN_COPTS = [
145145
"/DCURL_DISABLE_PROXY",
146146
"/DHAVE_LIBZ",
147147
"/DHAVE_ZLIB_H",
148-
"/DUSE_OPENSSL", # Changed: Use OpenSSL/BoringSSL interface
149-
"/DHAVE_BORINGSSL", # Changed: Explicitly define BoringSSL
148+
"/DUSE_OPENSSL",
149+
"/DHAVE_BORINGSSL",
150150
# Defining _USING_V110_SDK71_ is hackery to defeat curl's incorrect
151151
# detection of what OS releases we can build on with VC 2012. This
152152
# may not be needed (or may have to change) if the WINVER setting
@@ -159,7 +159,7 @@ CURL_WIN_SRCS = [
159159
"lib/inet_ntop.c",
160160
"lib/system_win32.c",
161161
"lib/x509asn1.c",
162-
"lib/vtls/openssl.c", # Changed: Use OpenSSL source instead of schannel.c
162+
"lib/vtls/openssl.c",
163163
"lib/idn_win32.c",
164164
]
165165

@@ -456,7 +456,7 @@ cc_library(
456456
":define-ca-bundle-location",
457457
"@com_github_cares_cares//:ares",
458458
"@zlib",
459-
"@boringssl//:ssl", # Changed: Link BoringSSL on Windows
459+
"@boringssl//:ssl",
460460
],
461461
)
462462

@@ -481,7 +481,6 @@ write_file(
481481
"# define BUILDING_LIBCURL 1",
482482
"# define CURL_DISABLE_CRYPTO_AUTH 1",
483483
"# define CURL_DISABLE_DICT 1",
484-
# REMOVED: "# define CURL_DISABLE_FILE 1",
485484
"# define CURL_DISABLE_GOPHER 1",
486485
"# define CURL_DISABLE_IMAP 1",
487486
"# define CURL_DISABLE_LDAP 1",
@@ -492,14 +491,14 @@ write_file(
492491
"# define CURL_DISABLE_TELNET 1",
493492
"# define CURL_DISABLE_TFTP 1",
494493
"# define CURL_PULL_WS2TCPIP_H 1",
495-
"# define USE_OPENSSL 1", // Changed
496-
"# define HAVE_BORINGSSL 1", // Changed
497-
"# define HAVE_LIBSSL 1", // Changed
498-
"# define HAVE_OPENSSL_SSL_H 1", // Changed
499-
"# define HAVE_OPENSSL_CRYPTO_H 1",// Changed
500-
"# define HAVE_OPENSSL_PEM_H 1", // Changed
501-
"# define HAVE_OPENSSL_X509_H 1", // Changed
502-
"# define HAVE_OPENSSL_ERR_H 1", // Changed
494+
"# define USE_OPENSSL 1",
495+
"# define HAVE_BORINGSSL 1",
496+
"# define HAVE_LIBSSL 1",
497+
"# define HAVE_OPENSSL_SSL_H 1",
498+
"# define HAVE_OPENSSL_CRYPTO_H 1",
499+
"# define HAVE_OPENSSL_PEM_H 1",
500+
"# define HAVE_OPENSSL_X509_H 1",
501+
"# define HAVE_OPENSSL_ERR_H 1",
503502
"# define USE_WIN32_IDN 1",
504503
"# define WANT_IDN_PROTOTYPES 1",
505504
"#elif defined(__APPLE__)",
@@ -546,7 +545,6 @@ write_file(
546545
"",
547546
"#if !defined(_WIN32)",
548547
"# define CURL_DISABLE_DICT 1",
549-
# REMOVED: "# define CURL_DISABLE_FILE 1",
550548
"# define CURL_DISABLE_GOPHER 1",
551549
"# define CURL_DISABLE_IMAP 1",
552550
"# define CURL_DISABLE_LDAP 1",

ci/kokoro/windows/builds/bazel.ps1

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -83,20 +83,10 @@ function Invoke-gRPC-Quickstart {
8383

8484
if (Test-Integration-Enabled) {
8585
Write-Host "`n$(Get-Date -Format o) Running minimal quickstart prorams"
86-
87-
# Install certificates and set up environment variables for BoringSSL
8886
Install-Roots-Pem
89-
90-
# BoringSSL prefers forward slashes for paths, even on Windows
91-
$RawRootsPath = Join-Path $env:KOKORO_GFILE_DIR "roots.pem"
92-
$RootsPath = $RawRootsPath -replace '\\', '/'
93-
$KeyPath = (Join-Path $env:KOKORO_GFILE_DIR "kokoro-run-key.json") -replace '\\', '/'
94-
95-
$env:GRPC_DEFAULT_SSL_ROOTS_FILE_PATH = $RootsPath
96-
$env:CURL_CA_BUNDLE = $RootsPath
97-
$env:SSL_CERT_FILE = $RootsPath
98-
$env:GOOGLE_APPLICATION_CREDENTIALS = $KeyPath
99-
87+
${env:GRPC_DEFAULT_SSL_ROOTS_FILE_PATH}="${env:KOKORO_GFILE_DIR}/roots.pem"
88+
${env:CURL_CA_BUNDLE}="${env:KOKORO_GFILE_DIR}/roots.pem"
89+
${env:GOOGLE_APPLICATION_CREDENTIALS}="${env:KOKORO_GFILE_DIR}/kokoro-run-key.json"
10090
Invoke-REST-Quickstart
10191
Invoke-gRPC-Quickstart
10292
}

ci/kokoro/windows/lib/integration.ps1

Lines changed: 10 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# you may not use this file except in compliance with the License.
55
# You may obtain a copy of the License at
66
#
7-
# https://www.apache.org/licenses/LICENSE-2.0
7+
# https://www.apache.org/licenses/LICENSE-2.0
88
#
99
# Unless required by applicable law or agreed to in writing, software
1010
# distributed under the License is distributed on an "AS IS" BASIS,
@@ -14,64 +14,32 @@
1414

1515
# Helper functions to run the minimal integration tests
1616

17-
$PROJECT_ROOT = (Get-Item -Path ".\").FullName
17+
$PROJECT_ROOT = (Get-Item -Path ".\" -Verbose).FullName
1818
$integration_tests_config="${PROJECT_ROOT}/ci/etc/integration-tests-config.ps1"
1919
. "${integration_tests_config}"
2020

2121
function Test-Integration-Enabled {
2222
if ((Test-Path env:KOKORO_GFILE_DIR) -and
2323
(Test-Path "${env:KOKORO_GFILE_DIR}/kokoro-run-key.json")) {
24-
return $True
24+
return $True
2525
}
2626
return $False
2727
}
2828

2929
function Install-Roots-Pem {
30-
$RootsPath = "${env:KOKORO_GFILE_DIR}/roots.pem"
31-
30+
Write-Host -ForegroundColor Yellow "`n$(Get-Date -Format o) " `
31+
"Downloading roots.pem [$_]"
3232
ForEach($attempt in (1, 2, 3)) {
33-
Write-Host -ForegroundColor Yellow "`n$(Get-Date -Format o) " `
34-
"Downloading roots.pem [$attempt]"
3533
try {
36-
# 1. Download the Mozilla Bundle
37-
$WebClient = New-Object System.Net.WebClient
38-
$MozillaCerts = $WebClient.DownloadString('https://curl.se/ca/cacert.pem')
39-
40-
# 2. Gather Windows System Root Certificates
41-
# This is required because some corporate/cloud environments inspect traffic
42-
# using an intermediate CA present in the system store but not in Mozilla's bundle.
43-
Write-Host "Gathering Windows System Root Certificates..."
44-
$WindowsCerts = ""
45-
$storesToCheck = @("Root", "CA")
46-
47-
foreach ($storeName in $storesToCheck) {
48-
$certStore = New-Object System.Security.Cryptography.X509Certificates.X509Store -ArgumentList $storeName, "LocalMachine"
49-
$certStore.Open('ReadOnly')
50-
51-
$certStore.Certificates | ForEach-Object {
52-
$cert = $_
53-
$b64 = [Convert]::ToBase64String($cert.Export([System.Security.Cryptography.X509Certificates.X509ContentType]::Cert), 'InsertLineBreaks')
54-
$header = "-----BEGIN CERTIFICATE-----"
55-
$footer = "-----END CERTIFICATE-----"
56-
$WindowsCerts += "$header`n$b64`n$footer`n"
57-
}
58-
$certStore.Close()
59-
}
60-
61-
# 3. Write Combined File with strict Unix Line Endings (\n)
62-
# BoringSSL/gRPC can sometimes have issues with Windows CRLF.
63-
Write-Host "Writing combined roots.pem with Unix LF line endings..."
64-
$FinalContent = $MozillaCerts + "`n" + $WindowsCerts
65-
$FinalContent = $FinalContent -replace "`r`n", "`n"
66-
67-
[System.IO.File]::WriteAllText($RootsPath, $FinalContent, [System.Text.Encoding]::ASCII)
68-
34+
(New-Object System.Net.WebClient).Downloadfile(
35+
'https://pki.google.com/roots.pem',
36+
"${env:KOKORO_GFILE_DIR}/roots.pem")
6937
return
7038
} catch {
71-
Write-Host -ForegroundColor Yellow "`n$(Get-Date -Format o) download/setup error: $_"
39+
Write-Host -ForegroundColor Yellow "`n$(Get-Date -Format o) download error"
7240
}
7341
Start-Sleep -Seconds (60 * $attempt)
7442
}
75-
Write-Host -ForegroundColor Red "cannot setup roots.pem file."
43+
Write-Host -ForegroundColor Red "cannot download roots.pem file."
7644
Exit 1
7745
}

0 commit comments

Comments
 (0)