git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: arnaud.brejeon@gmail.com
To: git@vger.kernel.org
Cc: arnaudbrejeon <arnaud.brejeon@gmail.com>
Subject: [PATCH 2/2] Add SVN trust-server-cert parameter to git svn to accept SSL server certificates from unknwon authorities without prompting
Date: Sat, 12 Oct 2013 11:23:30 +0200	[thread overview]
Message-ID: <1381569810-2167-2-git-send-email-arnaud.brejeon@gmail.com> (raw)
In-Reply-To: <1381569810-2167-1-git-send-email-arnaud.brejeon@gmail.com>

From: arnaudbrejeon <arnaud.brejeon@gmail.com>

Signed-off-by: Arnaud Brejeon <arnaud.brejeon <at> gmail.com>
---
 git-svn.perl           |    1 +
 perl/Git/SVN/Prompt.pm |    9 ++++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/git-svn.perl b/git-svn.perl
index 07f0a6c..3dfd4d3 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -124,6 +124,7 @@ $Git::SVN::Fetcher::_placeholder_filename = ".gitignore";
 $_q ||= 0;
 my %remote_opts = ( 'username=s' => \$Git::SVN::Prompt::_username,
                     'password=s' => \$Git::SVN::Prompt::_password,
+                    'trust-server-cert' => \$Git::SVN::Prompt::_trust_server_cert,
                     'config-dir=s' => \$Git::SVN::Ra::config_dir,
                     'no-auth-cache' => \$Git::SVN::Prompt::_no_auth_cache,
                     'ignore-paths=s' => \$Git::SVN::Fetcher::_ignore_regex,
diff --git a/perl/Git/SVN/Prompt.pm b/perl/Git/SVN/Prompt.pm
index a94a847..71459ad 100644
--- a/perl/Git/SVN/Prompt.pm
+++ b/perl/Git/SVN/Prompt.pm
@@ -2,7 +2,7 @@ package Git::SVN::Prompt;
 use strict;
 use warnings;
 require SVN::Core;
-use vars qw/$_no_auth_cache $_username $_password/;
+use vars qw/$_no_auth_cache $_username $_password $_trust_server_cert/;
 
 sub simple {
 	my ($cred, $realm, $default_username, $may_save, $pool) = @_;
@@ -32,6 +32,13 @@ sub simple {
 sub ssl_server_trust {
 	my ($cred, $realm, $failures, $cert_info, $may_save, $pool) = @_;
 	$may_save = undef if $_no_auth_cache;
+
+	if ( defined $_trust_server_cert)
+	{
+		$cred->may_save($may_save);	
+		return $SVN::_Core::SVN_NO_ERROR;
+	}
+	
 	print STDERR "Error validating server certificate for '$realm':\n";
 	{
 		no warnings 'once';
-- 
1.7.10.2 (Apple Git-33)

  reply	other threads:[~2013-10-12  9:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-12  9:23 [PATCH 1/2] Add password parameter to git svn commands and use it when provided instead of defaulting to end-user prompt arnaud.brejeon
2013-10-12  9:23 ` arnaud.brejeon [this message]
2013-10-14 14:11 ` Jonathan Nieder
2013-10-14 18:40   ` Eric Wong
2013-10-14 22:36     ` Jeff King
2013-10-14 23:35       ` Eric Wong
2013-10-15 17:07         ` arnaud brejeon
2013-10-21 17:06         ` arnaud brejeon
2013-10-25  7:24           ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1381569810-2167-2-git-send-email-arnaud.brejeon@gmail.com \
    --to=arnaud.brejeon@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).