Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate) - spring

org.activiti.engine.impl.bpmn.behavior.MailActivityBehavior: Ignoring email send error: Could not send e-mail in execution 622539
org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp.gmail.com:587
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1421)
at org.apache.commons.mail.Email.send(Email.java:1448
Having issue is Sending SMS through GMAIL in spring ACTIVITI
Properties file:
spring.datasource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
spring.datasource.url=jdbc:sqlserver://localhost;databaseName=ZMIS_erp
spring.datasource.username=sa
spring.datasource.password=admin.123
spring.activiti.mail-server-use-ssl=false
spring.activiti.mail-server-use-tls=true
spring.activiti.mail-server-user-name="learnwithanandh#gmail.com"
spring.activiti.mail-server-password="Anandh.30"
email.base.url=http://localhost:9090
zambart.upload.directory=c:/ZMIS/
logging.level.root=info

Related

Springboot 1.5 to springboot 2.0.9 migration failed for rabbitmq ssl

We have spring-boot 1.5 & spring-boot-starter-amqp:1.5.22 application in aws cloud and working fine with rabbitmq ssl enabled. After spring-boot 2.0.9 migration, rabbitmq ssl failed with following error.
ERROR o.s.a.r.l.SimpleMessageListenerContainer - Failed to check/redeclare auto-delete queue(s).
org.springframework.amqp.AmqpIOException: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
at org.springframework.amqp.rabbit.support.RabbitExceptionTranslator.convertRabbitAccessException(RabbitExceptionTranslator.java:71)
at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:407)
at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.createConnection(CachingConnectionFactory.java:588)
at org.springframework.amqp.rabbit.core.RabbitTemplate.doExecute(RabbitTemplate.java:1445)
at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:1426)
at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:1402)
at org.springframework.amqp.rabbit.core.RabbitAdmin.getQueueProperties(RabbitAdmin.java:368)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.redeclareElementsIfNecessary(SimpleMessageListenerContainer.java:1241)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1502)
Migration from Springboot 1.5 with rabbitmq to 2.0.9
Expected to connect rabbitmq with ssl enabled property.
Springboot2 we can skip the ssl certificate validation using setSkipServerCertificateValidation flag to true in rabbitmqconnectionfactory.

Relaying dissalowed Spring boot with Zoho

I am using Spring Boot and I have configured Zoho mail as smtp server. Following are my application properties pertaining to mail
spring.mail.host = smtp.zoho.com
spring.mail.port = 587
spring.mail.username= emialid
spring.mail.password = password
spring.mail.properties.mail.smtp.auth = true
spring.mail.properties.mail.smtp.starttls.enable=true
I am getting following error:
org.springframework.mail.MailSendException: Failed to close server connection after message failures; nested exception is javax.mail.MessagingException: Can't send command to SMTP host;
nested exception is:
java.net.SocketException: Connection closed by remote host. Failed messages: com.sun.mail.smtp.SMTPSendFailedException: 553 Relaying disallowed as <"Faran Anjum"#DESKTOP-3PBLRKB>
; message exception details (1) are:
Failed message 1:
com.sun.mail.smtp.SMTPSendFailedException: 553 Relaying disallowed as <"Faran Anjum"#DESKTOP-3PBLRKB>
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2267)
at com.sun.mail.smtp.SMTPTransport.finishData(SMTPTransport.java:2045)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1260)
at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:448)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:345)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:340)
at com.palmgrid.preparify.module.emailService.GmailSender.sendEmailThroughTemplate(GmailSender.java:46)
at com.palmgrid.preparify.module.emailService.GmailSender$$FastClassBySpringCGLIB$$e1c05267.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.aop.interceptor.AsyncExecutionInterceptor$1.call(AsyncExecutionInterceptor.java:115)
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
at java.util.concurrent.FutureTask.run(FutureTask.java)
at java.lang.Thread.run(Thread.java:745)
How to resolve this?
You have to mention setFrom() with an email address that you use as the username for auth.
Make sure that the username and the from address are same.

spring java mail smtp connection issue with outlook server

i am trying to send mail through spring java mail API and my mail server is outlook.
so i am facing below issues.
sometimes it make connection to smpt host and sometimes it return connection timeout.
below i am pasting stacktrace .
SMTP host:example.com.mail.protection.outlook.com, port: 25;
nested exception is:
java.net.ConnectException: Connection timed out (Connection timed out)
at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailS enderImpl.java:404)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSen derImpl.java:332)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSen derImpl.java:347)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSen derImpl.java:336)
at com.condivision.rentongo.service.MailService.sendMail(MailService.jav a:75)
at com.condivision.rentongo.service.MailService$$FastClassBySpringCGLIB$ $1ed18523.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:2 04)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterce ptor.intercept(CglibAopProxy.java:649)
at com.condivision.rentongo.service.MailService$$EnhancerBySpringCGLIB$$ 5228ed74.sendMail(<generated>)
at com.condivision.rentongo.service.OrderService.updateOrderAndInventory Status(OrderService.java:726)
at com.condivision.rentongo.service.OrderService$$FastClassBySpringCGLIB $$a056f002.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:2 04)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation .invokeJoinpoint(CglibAopProxy.java:717)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed( ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.

Secured Nifi Cluster Setup

I am trying to configure the 3node secured Nifi cluster setup by followinng the below Link .
But between nodes the connection not happened after enabled SSL/LDAP and i am getting the below error.
2017-04-01 09:05:47,494 WARN [Clustering Tasks Thread-2] o.apache.nifi.controller.FlowController Failed to send heartbeat due to: org.apache.nifi.cluster.protocol.ProtocolException: Failed marshalling 'HEARTBEAT' protocol message due to: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
2017-04-01 09:05:47,494 ERROR [Process Cluster Protocol Request-7] o.a.nifi.security.util.CertificateUtils The incoming request did not contain client certificates and thus the DN cannot be extracted. Check that the other endpoint is providing a complete client certificate chain
2017-04-01 09:05:47,494 WARN [Process Cluster Protocol Request-7] o.a.n.c.p.impl.SocketProtocolListener Failed processing protocol message from HKLPATHAS02.hk.example.com due to org.apache.nifi.cluster.protocol.ProtocolException: java.security.cert.CertificateException: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
org.apache.nifi.cluster.protocol.ProtocolException: java.security.cert.CertificateException: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
at org.apache.nifi.cluster.protocol.impl.SocketProtocolListener.getRequestorDN(SocketProtocolListener.java:221) ~[nifi-framework-cluster-protocol-1.1.0.2.1.1.0-2.jar:1.1.0.2.1.1.0-2]
at org.apache.nifi.cluster.protocol.impl.SocketProtocolListener.dispatchRequest(SocketProtocolListener.java:133) ~[nifi-framework-cluster-protocol-1.1.0.2.1.1.0-2.jar:1.1.0.2.1.1.0-2]
at org.apache.nifi.io.socket.SocketListener$2$1.run(SocketListener.java:136) [nifi-socket-utils-1.1.0.2.1.1.0-2.jar:1.1.0.2.1.1.0-2]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_102]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_102]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_102]
Caused by: java.security.cert.CertificateException: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
at org.apache.nifi.security.util.CertificateUtils.extractPeerDNFromClientSSLSocket(CertificateUtils.java:306) ~[nifi-security-utils-1.1.0.2.1.1.0-2.jar:1.1.0.2.1.1.0-2]
at org.apache.nifi.security.util.CertificateUtils.extractPeerDNFromSSLSocket(CertificateUtils.java:261) ~[nifi-security-utils-1.1.0.2.1.1.0-2.jar:1.1.0.2.1.1.0-2]
at org.apache.nifi.cluster.protocol.impl.SocketProtocolListener.getRequestorDN(SocketProtocolListener.java:219) ~[nifi-framework-cluster-protocol-1.1.0.2.1.1.0-2.jar:1.1.0.2.1.1.0-2]
... 5 common frames omitted
Caused by: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
at sun.security.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:431) ~[na:1.8.0_102]
at org.apache.nifi.security.util.CertificateUtils.extractPeerDNFromClientSSLSocket(CertificateUtils.java:291) ~[nifi-security-utils-1.1.0.2.1.1.0-2.jar:1.1.0.2.1.1.0-2]
... 7 common frames omitted
Please guide me to resolve this thread.
The error is saying that one node in the cluster is attempting to make a heartbeat connection to the other node, but it is not providing a valid client certificate in order to authenticate itself during the TLS handshake negotiation. There are a few possible reasons for this error:
The node is not sending the client certificate. Ensure that nifi.security.needClientAuth=true and nifi.cluster.protocol.is.secure=true are present in your nifi.properties file.
The truststore on the receiving node does not contain the public key certificate of the connecting node. When you followed the instructions from that link, how did you generate the respective certificates? Using the Apache NiFi TLS Toolkit as described by Pierre should ensure that all node certificates are signed by the same CA and that the CA is imported into the common truststore. If you manually generated your certificates, ensure that they are trusted on each node (you can do this with OpenSSL's s_client tool).

RECV TLSv1 ALERT: fatal, handshake_failure

Im using Jmeter2.9 for testing secured webservice.
i've created a keystore and truststore for the client and the root certificates and they seem to be fine.
however, when I start using the test script I get the following error message:
...
AWT-EventQueue-0, READ: TLSv1 Alert, length = 2
AWT-EventQueue-0, RECV TLSv1 ALERT: fatal, handshake_failure
AWT-EventQueue-0, called closeSocket()
AWT-EventQueue-0, handling exception: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
i tried to modify the parameters in user.properties, jmeter.properties and system.properties for jmeter, but it didnt help.
have you any hint or tips what causes the issue and how it could be solved?
thank you.

Resources