Revision 41421 trunk/org.gvsig.desktop/pom.xml
pom.xml | ||
---|---|---|
1933 | 1933 |
<phase>install</phase> |
1934 | 1934 |
<configuration> |
1935 | 1935 |
<source><![CDATA[ |
1936 |
|
|
1936 | 1937 |
// To deploy package use: |
1937 | 1938 |
// mvn -Ddeploy-package -Duser=USER -Dpassword=PASSWORD install |
1938 | 1939 |
// |
1939 |
|
|
1940 |
|
|
1940 | 1941 |
public class WebDAVClient { |
1941 | 1942 |
|
1942 | 1943 |
def log; |
... | ... | |
1946 | 1947 |
private Object sardine; |
1947 | 1948 |
|
1948 | 1949 |
public WebDAVClient(log) { |
1950 |
disableCertificateValidation(); |
|
1949 | 1951 |
this.log = log; |
1950 | 1952 |
} |
1951 | 1953 |
|
... | ... | |
2001 | 2003 |
List resources = sardine.list(url); |
2002 | 2004 |
return resources; |
2003 | 2005 |
} |
2006 |
|
|
2007 |
void disableCertificateValidation() { |
|
2008 |
/* |
|
2009 |
javax.net.ssl.TrustManager[] trustAllCerts = new javax.net.ssl.TrustManager[1]; |
|
2010 |
trustAllCerts[0] = new javax.net.ssl.X509TrustManager() { |
|
2011 |
public java.security.cert.X509Certificate[] getAcceptedIssuers() { |
|
2012 |
return new java.security.cert.X509Certificate[0]; |
|
2013 |
} |
|
2014 |
|
|
2015 |
public void checkClientTrusted(java.security.cert.X509Certificate[] xcs, String string) throws java.security.cert.CertificateException { |
|
2016 |
} |
|
2017 |
|
|
2018 |
public void checkServerTrusted(java.security.cert.X509Certificate[] xcs, String string) throws java.security.cert.CertificateException { |
|
2019 |
} |
|
2020 |
}; |
|
2021 |
|
|
2022 |
// Ignore differences between given hostname and certificate hostname |
|
2023 |
javax.net.ssl.HostnameVerifier hv = new javax.net.ssl.HostnameVerifier() { |
|
2024 |
public boolean verify(String hostname, javax.net.ssl.SSLSession session) { |
|
2025 |
return true; |
|
2026 |
} |
|
2027 |
}; |
|
2028 |
|
|
2029 |
// Install the all-trusting trust manager |
|
2030 |
try { |
|
2031 |
javax.net.ssl.SSLContext sc = javax.net.ssl.SSLContext.getInstance("SSL"); |
|
2032 |
sc.init(null, trustAllCerts, new java.security.SecureRandom()); |
|
2033 |
javax.net.ssl.HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); |
|
2034 |
javax.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier(hv); |
|
2035 |
} catch (Exception e) { |
|
2036 |
} |
|
2037 |
*/ |
|
2038 |
} |
|
2004 | 2039 |
} |
2005 | 2040 |
|
2006 |
|
|
2007 | 2041 |
if( project.properties["deploy-package"] != null ) { |
2008 | 2042 |
if( project.properties["gvsig.install.plugin.package"]=="true" ) { |
2009 | 2043 |
poolURL = project.properties["gvsig.package.info.poolURL"]; |
... | ... | |
2067 | 2101 |
} else { |
2068 | 2102 |
log.info("Skip plugin package deploy. Use the flags -Ddeploy-package -Duser=USER -Dpassword=PASSWORD to deploy it."); |
2069 | 2103 |
} |
2070 |
|
|
2104 |
|
|
2071 | 2105 |
]]></source> |
2072 | 2106 |
</configuration> |
2073 | 2107 |
</execution> |
Also available in: Unified diff