Re: TLS 1.1 and later in Java-based emulator

"James H. H. Lampert" <jamesl-6/ELSmrcqeUu8xhjR5IN5AC/[email protected]>
Newsgroups gmane.comp.lang.as400.java
Message-ID <[email protected]>
On 4/17/18, 11:11 AM, Krill, Coy wrote:
> If you use a properties file to configure your application then set
> these two properties properties based on your version of java being
> used (examples below). If you don't use a properties file then you
> will need to figure out a good place in your code to set these two
> properties or set them from the command line. The document your
> referenced has what you needed other than it skipped over the least
> used property but the one probably most relevant to your situation.
>
> Java 7+
> https.protocols=" TLSv1.2,TLSv1.1,TLSv1 "
> jdk.tls.client.protocols=" TLSv1.2,TLSv1.1,TLSv1 "

That didn't seem to have any effect at all. But after futzing around 
with it for two hours yesterday, a solution finally occurred to me:

Our current version instantiates and connects the SSLSocket in one swell 
foop:
> SSLSocket s = (SSLSocket)factory.createSocket(adr, port);

If instead, I instantiate it and connect it in separate steps, I can 
then do a setEnabledProtocols() on it (if we're running under Java 7) 
BEFORE we connect it.

--
JHHL
-- 
This is the Java Programming on and around the IBM i (JAVA400-L) mailing list
To post a message email: JAVA400-L-Zwy7GipZuJhWk0Htik3J/[email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request-Zwy7GipZuJhWk0Htik3J/[email protected]
Before posting, please take a moment to review the archives
at https://archive.midrange.com/java400-l.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.