diff --git a/WHATSNEW b/WHATSNEW index cc4a0a622c..779c314b56 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -12,6 +12,11 @@ Other changes: Bugzilla Report 26453 + * Removes direct references to com.sun.net.ssl.internal.ssl.Provider class + from the mail task, since that internal JDK class is no longer available + in recent versions of Java. + Bugzilla Report 68460 + Fixed bugs: ----------- diff --git a/src/main/org/apache/tools/ant/taskdefs/email/JakartaMimeMailer.java b/src/main/org/apache/tools/ant/taskdefs/email/JakartaMimeMailer.java index a1ebb983c1..0055c5ffca 100644 --- a/src/main/org/apache/tools/ant/taskdefs/email/JakartaMimeMailer.java +++ b/src/main/org/apache/tools/ant/taskdefs/email/JakartaMimeMailer.java @@ -25,8 +25,6 @@ import java.io.OutputStream; import java.io.PrintStream; import java.io.UnsupportedEncodingException; -import java.security.Provider; -import java.security.Security; import java.util.ArrayList; import java.util.List; import java.util.Locale; @@ -148,15 +146,6 @@ public void send() { Session sesh; Authenticator auth = null; if (SSL) { - try { - final Provider p = - Class.forName("com.sun.net.ssl.internal.ssl.Provider") - .asSubclass(Provider.class).getDeclaredConstructor().newInstance(); - Security.addProvider(p); - } catch (final Exception e) { - throw new BuildException( - "could not instantiate ssl security provider, check that you have JSSE in your classpath"); - } // SMTP provider props.put("mail.smtp.socketFactory.class", SSL_FACTORY); props.put("mail.smtp.socketFactory.fallback", "false"); diff --git a/src/main/org/apache/tools/ant/taskdefs/email/MimeMailer.java b/src/main/org/apache/tools/ant/taskdefs/email/MimeMailer.java index 387078b8a4..54514b9843 100644 --- a/src/main/org/apache/tools/ant/taskdefs/email/MimeMailer.java +++ b/src/main/org/apache/tools/ant/taskdefs/email/MimeMailer.java @@ -25,8 +25,6 @@ import java.io.OutputStream; import java.io.PrintStream; import java.io.UnsupportedEncodingException; -import java.security.Provider; -import java.security.Security; import java.util.ArrayList; import java.util.List; import java.util.Locale; @@ -150,15 +148,6 @@ public void send() { Session sesh; Authenticator auth = null; if (SSL) { - try { - final Provider p = - Class.forName("com.sun.net.ssl.internal.ssl.Provider") - .asSubclass(Provider.class).getDeclaredConstructor().newInstance(); - Security.addProvider(p); - } catch (final Exception e) { - throw new BuildException( - "could not instantiate ssl security provider, check that you have JSSE in your classpath"); - } // SMTP provider props.put("mail.smtp.socketFactory.class", SSL_FACTORY); props.put("mail.smtp.socketFactory.fallback", "false");