Skip to content

Commit

Permalink
Fix System.Net.Security.Enterprise.Tests build (#84795)
Browse files Browse the repository at this point in the history
* Fix enterprise linux build

Ensure a recent lld is available on the build host

* Remove lld

As it is now installed in the ubuntu-22.04 image

* Try enabling legacy provider

* Fix legacy under [provider_sect]
  • Loading branch information
sbomer committed Apr 21, 2023
1 parent abaad8f commit ab2b80d
Showing 1 changed file with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04

# Prevents dialog prompting when installing packages
ARG DEBIAN_FRONTEND=noninteractive
Expand All @@ -8,6 +8,27 @@ COPY ./common/krb5.conf /etc/krb5.conf
RUN apt-get update && \
apt-get install -y --no-install-recommends krb5-user gss-ntlmssp iputils-ping dnsutils nano

# Enable openssl legacy provider in system openssl config
RUN fixOpensslConf=$(mktemp) && \
printf "#!/usr/bin/env sh\n\
sed -i '\n\
# Append 'legacy = legacy_sect' after 'default = default_sect' under [provider_sect]
/^default = default_sect/a legacy = legacy_sect\n\
# Search for [default_sect]
/\[default_sect\]/ {\n\
# Go to next line
n\n\
# Uncomment '# activate = 1'
s/# //\n\
# Append new [legacy_sect], with 'activate = 1'
a\n\
a [legacy_sect]\n\
a activate = 1\n\
}\n\
' /etc/ssl/openssl.cnf\n" > $fixOpensslConf && \
sh $fixOpensslConf && \
rm $fixOpensslConf

# Set environment variable to turn on enterprise tests
ENV DOTNET_RUNTIME_ENTERPRISETESTS_ENABLED 1

Expand Down

0 comments on commit ab2b80d

Please sign in to comment.