sslsocketfactory

Extending ssl/tls-message to be re-entrant in a java program

谁都会走 提交于 2021-02-11 12:26:54
问题 I'm extending the following question/solution to be re-entrant for connecting/submitting subsequent emails to an SMTP email server (e.g., Comcast), with TLS encryption. Unsupported or unrecognized ssl-message exception at startHandshake after issuing STARTTLS command in a java program I've been successful in studying and prototyping user9191556's algorithm and adapting it for subsequent emails. After much trial-n-error, I was successful in applying his/her TLS encryption capability to my

Vimeo Networking Library Crash for Android 10 platform (api29)

爱⌒轻易说出口 提交于 2021-02-10 06:16:10
问题 I implemented vimeo networking using vimeo networking library(https://github.com/vimeo/vimeo-networking-java), exoplayer and explained in this post https://stackoverflow.com/a/65737556/8814924 Now the problem is when I was checking with API 30 it was getting error java.lang.RuntimeException: Unable to start activity ComponentInfo{com.emergingit.emergingstudy/com.emergingit.emergingstudy.activities.course.ExoPlayerActivity}: java.lang.IllegalStateException: Unable to extract the trust manager

SSLSocketFactory in Java, LDAP network connection

心不动则不痛 提交于 2020-03-23 08:05:31
问题 My question is similar to: SSLSocketFactory in java I need to set a custom SSLSocketFactory...except I do NOT have an https connection (it's LDAPS), so can't use: HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); ...to set the SSLSocketFactory. I have an SSLContext object initialized but when I make the LDAP connection the default SSLContext is called automatically since my custom one is not set: dirContext = new InitialDirContext(env); // <-- reverts to default ssl

Websphere 7 javax.mail.MessagingException: SSLSocketFactory is null

允我心安 提交于 2019-12-23 05:45:09
问题 I am trying to connect to mail server using SSL, running on Websphere 7. I have no problem running the code as a standalone test main method, everything goes fine. I have also no problem running the code on Websphere - connecting to mail server (example imap.seznam.cz), but when I do not use SSL. In case I want to use SSL, exception is thrown like this: javax.mail.MessagingException: SSLSocketFactory is null. This can occur if javax.net.ssl.SSLSocketFactory.getDefault() is called to create a

How make SSL server socket support both http & https in java?

怎甘沉沦 提交于 2019-12-21 17:44:27
问题 I'm trying to create simple web server using java sockets which should support both http & https. But i can acheive only one at a time. I need to logic which supports both http @ port 80 & https @ port 443 at same time. This is the sample code for HTTPS Server using sslsocket. We can acheive HTTP Server using simple ServerSocket. public class HttpsServer { public static void main(String[] args) { try { KeyStore ks = KeyStore.getInstance("PKCS12"); ks.load(new FileInputStream("/opt/p12file.p12

Why does SSLSocketFactory lack setEnabledCipherSuites?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-09 17:39:05
问题 SSLSocketFactory provides getDefaultCipherSuites (ciphers that are enabled by default on sockets) and getSupportedCipherSuites (ciphers that can be enabled, if desired). However, SSLSocketFactory does not offer setEnabledCipherSuites to configure the cipher list once to provide the preference on subsequent sockets. In fact, I think making setEnabledCipherSuites part of SSLSocket really complicates wok flows. For example, HttpsURLConnection does not provide a getSocket , and it really breaks

java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.NETWORK

我的未来我决定 提交于 2019-12-09 06:56:45
问题 java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.NETWORK Hi i got this error while i am calling one API service from retrofit , i am searching a lot and found answer like private static void setupRestClient() { RestAdapter restAdapter = new RestAdapter.Builder() .setLogLevel(RestAdapter.LogLevel.FULL) .setEndpoint(ROOT) //.setClient(new OkClient(new com.squareup.okhttp.OkHttpClient())) //.setClient(getOkClient()) .setClient(setSSLFactoryForClient

Why does SSLSocketFactory lack setEnabledCipherSuites?

寵の児 提交于 2019-12-04 05:22:04
SSLSocketFactory provides getDefaultCipherSuites (ciphers that are enabled by default on sockets) and getSupportedCipherSuites (ciphers that can be enabled, if desired). However, SSLSocketFactory does not offer setEnabledCipherSuites to configure the cipher list once to provide the preference on subsequent sockets. In fact, I think making setEnabledCipherSuites part of SSLSocket really complicates wok flows. For example, HttpsURLConnection does not provide a getSocket , and it really breaks this flow: ... SSLContext context = SSLContext.getInstance("TLS"); context.init(null, trustManager

How to build a SSLSocketFactory from PEM certificate and key without converting to keystore?

帅比萌擦擦* 提交于 2019-12-03 13:27:51
问题 I'm given a self-signed client certificate kit that is to be used to access a server via HTTPS. The kit consists of the following PEM files: client.crt (client certificate) client.key (client private key) ca.crt (CA certificate) One way to solve the task is to generate a Java keystore: Use openssl to convert client certificate and key to PKCS12 keystore Use keytool to import CA certificate to the store ... and then use code like the following to build SSLSocketFactory instance: InputStream

Now that SSLSocketFactory is deprecated on Android, what would be the best way to handle Client Certificate Authentication?

╄→尐↘猪︶ㄣ 提交于 2019-12-03 05:06:00
问题 I am working on an Android app that requires Client Certificate Authentication (with PKCS 12 files). Following the deprecation of all that's apache.http.* , we have started a pretty big work of refactoring on our network layer, and we have decided to go with OkHttp as a replacement, and so far I like that very much. However, I haven't found any other way to handle client certificate auth without using SSLSocketFactory , with OkHttp or anything else for that matter. So what would be the best