Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
sap-service
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
sap-service
Commits
16a35925
Commit
16a35925
authored
Aug 15, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
9d6ac3b1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
SAPServiceFactory.java
src/main/java/com/egolm/sso/clients/SAPServiceFactory.java
+15
-5
No files found.
src/main/java/com/egolm/sso/clients/SAPServiceFactory.java
View file @
16a35925
...
@@ -6,6 +6,8 @@ import java.io.IOException;
...
@@ -6,6 +6,8 @@ import java.io.IOException;
import
java.net.MalformedURLException
;
import
java.net.MalformedURLException
;
import
java.net.URL
;
import
java.net.URL
;
import
java.security.KeyStore
;
import
java.security.KeyStore
;
import
java.security.cert.CertificateException
;
import
java.security.cert.X509Certificate
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -13,6 +15,7 @@ import javax.net.ssl.KeyManager;
...
@@ -13,6 +15,7 @@ import javax.net.ssl.KeyManager;
import
javax.net.ssl.KeyManagerFactory
;
import
javax.net.ssl.KeyManagerFactory
;
import
javax.net.ssl.TrustManager
;
import
javax.net.ssl.TrustManager
;
import
javax.net.ssl.TrustManagerFactory
;
import
javax.net.ssl.TrustManagerFactory
;
import
javax.net.ssl.X509TrustManager
;
import
javax.security.auth.callback.Callback
;
import
javax.security.auth.callback.Callback
;
import
javax.security.auth.callback.CallbackHandler
;
import
javax.security.auth.callback.CallbackHandler
;
import
javax.xml.namespace.QName
;
import
javax.xml.namespace.QName
;
...
@@ -71,10 +74,9 @@ public class SAPServiceFactory {
...
@@ -71,10 +74,9 @@ public class SAPServiceFactory {
HTTPConduit
httpConduit
=
(
HTTPConduit
)
client
.
getConduit
();
HTTPConduit
httpConduit
=
(
HTTPConduit
)
client
.
getConduit
();
TLSClientParameters
tlsParams
=
httpConduit
.
getTlsClientParameters
();
TLSClientParameters
tlsParams
=
httpConduit
.
getTlsClientParameters
();
tlsParams
=
tlsParams
==
null
?
new
TLSClientParameters
()
:
tlsParams
;
tlsParams
=
tlsParams
==
null
?
new
TLSClientParameters
()
:
tlsParams
;
tlsParams
.
setSecureSocketProtocol
(
SSLProtocol
);
tlsParams
.
setKeyManagers
(
getKeyManagers
());
tlsParams
.
setTrustManagers
(
getTrustManagers
());
httpConduit
.
setTlsClientParameters
(
tlsParams
);
httpConduit
.
setTlsClientParameters
(
tlsParams
);
tlsParams
.
setTrustManagers
(
new
TrustManager
[]
{
new
TrustAllManager
()
});
tlsParams
.
setDisableCNCheck
(
true
);
}
}
}
}
return
service
;
return
service
;
...
@@ -110,10 +112,18 @@ public class SAPServiceFactory {
...
@@ -110,10 +112,18 @@ public class SAPServiceFactory {
}
}
private
class
TrustAllManager
implements
X509TrustManager
{
public
void
checkClientTrusted
(
X509Certificate
[]
arg0
,
String
arg1
)
throws
CertificateException
{}
public
void
checkServerTrusted
(
X509Certificate
[]
arg0
,
String
arg1
)
throws
CertificateException
{}
public
X509Certificate
[]
getAcceptedIssuers
()
{
return
null
;
}
}
private
static
TrustManager
[]
trustManagers
=
null
;
private
static
TrustManager
[]
trustManagers
=
null
;
private
static
KeyManager
[]
keyManagers
=
null
;
private
static
KeyManager
[]
keyManagers
=
null
;
p
rivate
TrustManager
[]
getTrustManagers
()
{
p
ublic
TrustManager
[]
getTrustManagers
()
{
if
(
trustManagers
==
null
)
{
if
(
trustManagers
==
null
)
{
FileInputStream
fis
=
null
;
FileInputStream
fis
=
null
;
try
{
try
{
...
@@ -140,7 +150,7 @@ public class SAPServiceFactory {
...
@@ -140,7 +150,7 @@ public class SAPServiceFactory {
return
trustManagers
;
return
trustManagers
;
}
}
p
rivate
KeyManager
[]
getKeyManagers
()
{
p
ublic
KeyManager
[]
getKeyManagers
()
{
if
(
keyManagers
==
null
)
{
if
(
keyManagers
==
null
)
{
FileInputStream
fis
=
null
;
FileInputStream
fis
=
null
;
try
{
try
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment