Skip to content

installer: add option to choose curl variant (openssl or winssl) - #135

Closed
Radrik5 wants to merge 1 commit into
git-for-windows:masterfrom
Radrik5:winssl
Closed

Radrik5 wants to merge 1 commit into
git-for-windows:masterfrom
Radrik5:winssl

Conversation

@Radrik5

@Radrik5 Radrik5 commented Feb 26, 2017 •

Copy link
Copy Markdown
Contributor

Implementation of approach suggested in git-for-windows/git#301 (comment)

Works as expected on Windows 7 64 bit.

Things to be done/disscussed:

  • Write selected option to install-options.txt
  • Use dontcopy with curl-winssl files and overwrite installed curl-openssl
  • Create separate page with curl settings

@Radrik5

Radrik5 commented Feb 26, 2017 •

Copy link
Copy Markdown
Contributor Author

curl-winssl may not work on Windows <= XP: curl/curl@7475c47

And lacks TLS-SRP, HTTP2, and HTTPS-proxy features:

curl $ /mingw64/bin/curl-winssl/curl.exe --version
curl 7.53.1 (x86_64-w64-mingw32) libcurl/7.53.1 WinSSL zlib/1.2.11 libssh2/1.8.0 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smtp smtps telnet tftp
Features: IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL libz Metalink
curl $ /mingw64/bin/curl.exe --version
curl 7.53.0 (x86_64-w64-mingw32) libcurl/7.53.0 OpenSSL/1.0.2k zlib/1.2.11 libssh2/1.8.0 nghttp2/1.19.0 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smtp smtps telnet tftp
Features: IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL libz TLS-SRP HTTP2 HTTPS-proxy Metalink
curl $ echo openssl && git clone https://github.com/git-for-windows/git.git

So maybe we should leave it disabled by default.

@dscho

dscho commented Feb 26, 2017

Copy link
Copy Markdown
Member

curl-winssl may not work on Windows <= XP

Git for Windows does not support XP any longer since v2.10.1...

So maybe we should leave it disabled by default.

I agree.

@dscho dscho left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I never thought about bundling the winssl files in git-extra... interesting idea. My main gripe with this: winssl should be coupled with the version of mingw-w64-curl, not of git-extra...

@dscho

dscho commented Mar 1, 2017

Copy link
Copy Markdown
Member

git-extra: add curl-winssl

I think we want to skip this commit now. Better install the mingw-w64-curl-winssl-bin package as part of the regular installer/package building:

# Packages that have been added after Git SDK 1.0.0 was released...
required=
for req in mingw-w64-$ARCH-connect git-flow unzip docx2txt \
mingw-w64-$ARCH-antiword mingw-w64-$ARCH-xpdf \
mingw-w64-$ARCH-git-credential-manager ssh-pageant
do
test -d /var/lib/pacman/local/$req-[0-9]* ||
test -d /var/lib/pacman/local/$req-git-[0-9]* ||
required="$required $req"
done
and
packages="$packages mingw-w64-$ARCH-git-doc-html ncurses mintty vim
winpty less gnupg tar diffutils patch dos2unix which subversion
mingw-w64-$ARCH-tk mingw-w64-$ARCH-connect git-flow docx2txt
mingw-w64-$ARCH-antiword ssh-pageant"

@dscho

dscho commented Mar 1, 2017

Copy link
Copy Markdown
Member

and

packages="$packages mingw-w64-$ARCH-git-doc-html ncurses mintty vim
winpty less gnupg tar diffutils patch dos2unix which subversion
mingw-w64-$ARCH-tk mingw-w64-$ARCH-connect git-flow docx2txt
mingw-w64-$ARCH-antiword ssh-pageant"

... actually, I take that back. I would like to include the winssl binaries only in the installer, not in PortableGit or anywhere else (because there is no easy way in that case to configure anything).

Instead, I would like to suggest including the files in the same way as edit-git-bash.exe (i.e. with the dontcopy flag) and overwriting the existing curl.exe/libcurl-4.dll with the bundled versions if the user selects WinSSL.

And I agree with @dra27 that a separate page would be nice... It is definitely more of a hassle to add, I agree. See 0f1aba2 for an example how to add a full new page.

@Radrik5

Radrik5 commented Mar 1, 2017

Copy link
Copy Markdown
Contributor Author

OK, I agree, having a separate page will be better. I spend an hour on this each morning, so something will probably be ready on Friday.

@fourpastmidnight

Copy link
Copy Markdown
Contributor

See the issue backing this PR for a nice dialog wireframe.

@dscho For MSI, I would create a feature. The user's feature choice would dictate which files get copied (and to where). Does InnoSetup provide a similar ability? This way, all the files are included in the installer, but depending on the user's choice, either one set of files or the other will actually be installed.

@dscho

dscho commented Mar 1, 2017 via email

Copy link
Copy Markdown
Member

@Radrik5

Radrik5 commented Mar 3, 2017

Copy link
Copy Markdown
Contributor Author

The code is ready but I've done only smoke testing on Windows 10 64 bit.
I'll test 32 bit and 64 bit versions tomorrow.

Here is how the new page looks:
image

$ curl --version
curl 7.53.1 (x86_64-w64-mingw32) libcurl/7.53.1 WinSSL zlib/1.2.11 libssh2/1.8.0 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smtp smtps telnet tftp
Features: IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL libz Metalink

$ cat /etc/install-options.txt
Path Option: Cmd
SSH Option: OpenSSH
CURL Option: WinSSL
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Performance Tweaks FSCache: Enabled
Use Credential Manager: Enabled
Enable Symlinks: Disabled

make-file-list.sh: install mingw-w64-curl-winssl-bin and verify that it
has the same version as mingw-w64-curl. The version check protects us
from shipping installer with outdated curl version (winssl or openssl).

Files from the winssl-bin package are not listed by the script in order
not to include them into portable Git version. The files are included
into installer with dontcopy flag and the code overwrites default curl
binaries with the extracted winssl ones. DestName parameter is specified
to avoid collision with default curl.exe and libcurl-4.dll files
(ExtractTemporaryFile uses only file name without file path).

Separate page "Choosing HTTPS implementation" is added to the installer
after discusssion: git-for-windows/git#301

Signed-off-by: Dmitry Oksenchuk <[email protected]>
@Radrik5

Radrik5 commented Mar 4, 2017

Copy link
Copy Markdown
Contributor Author

I've made minor changes to the code and tested 64-installer in the following cases:

  • Fresh installation (OpenSSL is selected by default);
  • Upgrade from previous version (OpenSSL is selected by default);
  • Reinstallation (previously selected option is selected by default).

When OpenSSL version is installed, Git respects http.sslCAInfo config and to make it clone our internal repository I have to set http.sslCAInfo to a file that contains our internal root certificate. When WinSSL version is installed, Git works with our internal repository "out of the box" but ignores http.sslCAInfo config.

I haven't tested 32-bit installer because I haven't found a way how build it on a 64-bit system. Even in mingw32 shell release.sh builds 64-bin installer because uname -m returns x86_64.

I think the code is ready for review and merge, so I'm removing the [WIP] prefix.

@Radrik5 Radrik5 changed the title [WIP] Install curl-winssl as an alternative to curl built with openssl (#301) installer: add option to choose curl variant (openssl or winssl) Mar 4, 2017
dscho added a commit that referenced this pull request Mar 15, 2017
This topic branch introduces Secure Channel support, based on
#135

The idea is that we ship two versions of cURL: one backed by OpenSSL
that uses the familiar ca-bundle.crt for certificates, and another one
backed by Windows' own Secure Channel component that uses the
certificates in the Windows Certificate Store.

The advantage of using the Windows Certificate Store is that the
certificate management is much, much easier in a corporate setting:
certificates can be distributed via Active Directory Domain Services.

By default, the OpenSSL variant is used, for backwards-compatibility.

This addresses git-for-windows/git#301 at
long last.

Signed-off-by: Johannes Schindelin <[email protected]>
@dscho

dscho commented Mar 16, 2017

Copy link
Copy Markdown
Member

Oh crap. I must have rebased a little bit too eagerly and re-committed this patch as 1315b8c. Sorry about that!

In short, though: thank you for your excellent contribution, it makes a huge difference!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants