0

Alfresco を使用しているプロジェクトで Buildr を使用したいと思いました。Alfresco プロジェクトは、 https ://artifacts.alfresco.com で Maven リポジトリを維持しています。

ご覧のとおり、https を使用しています。

次のように宣言して、2 つの jar + 依存関係をクラスパスにダウンロードしようとします。

ALFRESCO_CORE= transitive('org.alfresco:alfresco-core:jar:4.2.b')

ALFRESCO_REPOSITORY= transitive('org.alfresco:alfresco-repository:jar:4.2.b')

ビルドファイルが失敗し、次のエラー メッセージが表示されます。

Requesting https://artifacts.alfresco.com/org/alfresco/alfresco-core/4.2.b/alfresco-core-4.2.b.pom warning: peer certificate won't be verified in this SSL session Buildr aborted! RuntimeError : Failed to download org.alfresco:alfresco-core:pom:4.2.b, tried the following repositories: http://repo1.maven.org/maven2/ https://artifacts.alfresco.com/

これは、ビルダーがmavenリポジトリ証明書を信頼していないという事実によるものだと思いますか?

証明書を受け入れるようにするにはどうすればよいですか? または、証明書の検証をスキップしますか?

現在、リポジトリにアクセスできないのは主要なショーストッパーです:(

誰かが進め方のヒントを教えてくれることを願っています! あがた

4

2 に答える 2

2

少なくともここからは、この問題の広告を再現できません。ssl 証明書は有効であるように見えます。これをテストするために使用したビルドファイルは次のとおりです。

repositories.remote << 'https://artifacts.alfresco.com/nexus/content/groups/public/'
repositories.remote << 'https://artifacts.alfresco.com/nexus/content/groups/public-snapshots/'
repositories.remote << 'http://repo1.maven.org/maven2'

project 'foo' do
  project.group = 'x'
  project.version = 'x'
  compile.with transitive('org.alfresco:alfresco-core:jar:4.2.b')
end

ただし、SSL 証明書が有効ではなく、気にしない場合は、次の内容のファイル tasks/ssl_fix.rake を追加して、buildr クラスにモンキー パッチを適用できるはずです。

module URI
  class HTTP
    def connect
      if proxy = proxy_uri
        proxy = URI.parse(proxy) if String === proxy
        http = Net::HTTP.new(host, port, proxy.host, proxy.port, proxy.user, proxy.password)
      else
        http = Net::HTTP.new(host, port)
      end
      if self.instance_of? URI::HTTPS
        require 'net/https'
        # Patch so verifying is not a problem
        http.verify_mode = OpenSSL::SSL::VERIFY_NONE
        http.use_ssl = true
      end
      yield http
    end
  end
end

HTH

于 2013-01-11T23:52:23.443 に答える
1

warning: peer certificate won't be verified in this SSL session

メッセージのこの部分は、rubyが証明書の検証を試みないことを示しているため、これはSSLの問題ではないと思います。

エラーメッセージのURLには実際にアーティファクトがないようです。

$ curl -v -IHEAD https://artifacts.alfresco.com/org/alfresco/alfresco-core/4.2.b/alfresco-core-4.2.b.pom
[...]
> HEAD /org/alfresco/alfresco-core/4.2.b/alfresco-core-4.2.b.pom HTTP/1.1
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5
> Host: artifacts.alfresco.com
> Accept: */*
> 
< HTTP/1.1 404 Not Found

これは、アーティファクト名またはリポジトリに問題があることを示しています。Peterの作業例では、リポジトリを使用していますhttps://artifacts.alfresco.com/nexus/content/groups/public/。エラーメッセージのURLから、を使用しているように見えますhttps://artifacts.alfresco.com/。PeterのリポジトリURLを試すことができますか?

于 2013-01-16T00:14:47.507 に答える