Comments (6)
So it looks like we can get around this by adding this import to com.icegreen.greenmail.util.DummySSLSocketFactory
import com.sun.net.ssl.internal.ssl.SSLSocketImpl;
The primary issue here is that we'd be using what appears to be an internal/deprecated library. No idea if this is going to continue being supported in Java 8 and beyond.
from greenmail.
We can avoid the import by using reflection: try to find out if "setHost" is available and if this is the case set it. This is of course not a very nice fix but I would very much like to keep the setHost in there. In my (Windows) environment the reverse lookup is unbearably slow and I don't see any other way of circumventing this problem.
What I'm surprised about is that greenmail doesn't build on Oracle JDK 6 when it does build on Oracle JDK 7 (see https://travis-ci.org/greenmail-mail-test/greenmail ). Another way of dealing with this problem would be to just bump the java version to 1.7. What do you say?
from greenmail.
Hi Christian - thanks for welcoming me to the project.
I believe we should avoid limiting the build scope of Greenmail to Java 1.7 and above. Java 1.6 is still being supported by Oracle and a lot of users (myself included) are using Greenmail in Java 1.6 environments.
Reflection is definitely a possibility but what if we were to extend the default Java SecurityManager class and override the methods that cause reverse DNS lookups for SSL chains to do nothing. Then we can do something like:
System.setSecurityManager(new ExtendedSecurityManager());
This has the downside of introducing potential security issues when dealing with SSL.
from greenmail.
Reverse DNS lookup latency appears to manifest itself only on Windows OS. For more details see the following Java bug reports.
- http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4939977
- http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4653680
from greenmail.
Yeah, I guessed that this is a windows issue but sadly many develper computers run windows (including mine...). I think supporting jdk6 is generally a good thing so i would tend to use the reflection "solution". The DummySSLSocketFactory is only used for testing anyways.
Sadly travis ci doesn't support jdk6 so we can not Continuous Integration on jdk6. This means that changes that break compatibility with jdk6 are hard to spot.
Anyways, I "corrected" the problem now
from greenmail.
If you have a suggestion on how to fix this issue in a better way pleaselet me know
from greenmail.
Related Issues (20)
- Update jetty to 11.0.18
- Update jersey to 3.0.12
- Update log4j2 to 2.21.1
- Update junit5 to 5.10.1
- Update easymock to 5.2.0
- Update container base image to azul/zulu-openjdk:11.0.21-jre
- `\*` is not a valid IMAP `flag` HOT 4
- Bump spring.version from 5.3.25 to 5.3.31
- Backport: SearchCommandParser$SearchOperator cannot be cast to j.m.search.SearchTerm
- Backport: Support RFC5233 subaddress handling
- Backport: Preload email files during greenmail start
- Backport: Support configuring key password for custom TLS certificate
- Update container base image to azul/zulu-openjdk:8u392-jre
- Update jetty to 9.4.53.v20231009
- Update jersey to 2.41
- Update junit to 5.10.1
- Update easymock to 5.2.0
- Update spring.version to 5.3.31
- Update com.sun.activation:jakarta.activation to 1.2.2
- Support building using JDK 21
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from greenmail.