SSL does not work in Oracle Weblogic Server - java

I configured all SSL settings in Weblogic Server Administration Console. SSL port is 7102, I also used demo truststore, keystore, which was installed with OES.
So it doesn't work. When I open https(no urls)site.ru:7102 I get http 404 error.
I check listening ports with netstat on the server and there is not any process which listen port 7102. When I try edit SSL port in Weblogic Server Administration Console nothing happens. I also tried change common "Listen Port" and "Activate Changes" but nothing happens, Weblogic Server still works on old port - 7101.
When I use OES Client config util, which connect with server throw SSL I get this exception:
java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:618)
at sun.security.ssl.SSLSocketImpl.<init>(SSLSocketImpl.java:407)
at sun.security.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:88)
at oracle.security.oes.enroll.EnrollmentClient.enroll(EnrollmentClient.java:135)
at oracle.security.oes.enroll.EnrollmentClient.main(EnrollmentClient.java:478)
at oracle.security.oes.tools.EnrollmentTool.doEnroll(EnrollmentTool.java:103)
at oracle.security.oes.tools.SMConfigTool.doEnrollment(SMConfigTool.java:1192)
at oracle.security.oes.tools.SMConfigTool.run(SMConfigTool.java:617)
at oracle.security.oes.tools.SMConfigTool.main(SMConfigTool.java:546)
Connection refused: connect
Tell me, please, what could be the reason. What should I do to run SSL listening on Weblogic?

Try three options...
Take a backup of config.xml and edit it by placing the ssl port make sure ssl port enabled tag is true
Goto admin console there also change the ssl port as per your requirement what you put in the config.xml
3.Make sure you opened that port in firewall
Goto Run -> wf.msc -> inbound connection -> new rule -> port -> finish
Restart all the nodes (Both admin and managed)

Related

Zookeeper connection refuse in cluster mode

I want to built the zookeeper cluster in three cloud servers (centos 7) but it is desperate that it hasn't started successful yet....
Here is the conf:
zoo1:
clientPort=2181
dataDir=/tmp/zookeeper/data
syncLimit=5
initLimit=10
tickTime=2000
server.1=0.0.0.0:2888:3888
server.2=x.x.x.x:2888:3888
server.3=x.x.x.x:2888:3888
The other two machines had setup the corresponding localhost to 0.0.0.0 respectively, and confirmed that the iptables and firewalld is closed.
Everytime I run 'zkServer.sh start', it prints STARTED, like this:
[root#VM_144_102_centos zookeeper-3.5.2-alpha]# zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /home/iuShu/components/zookeeper/zookeeper-3.5.2-alpha/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
but their state is...
[root#VM_144_102_centos zookeeper-3.5.2-alpha]# zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /home/iuShu/components/zookeeper/zookeeper-3.5.2-alpha/bin/../conf/zoo.cfg
Client port found: 2181. Client address: localhost.
Error contacting service. It is probably not running.
I can see the election port 3888 is listening by using 'netstat -tunlp' and also telnet is OK, here is the primary logs:
2017-12-12 22:06:58,914 [myid:3] - WARN [WorkerSender[myid=3]:QuorumCnxManager#459] - Cannot open channel to 2 at election address /x.x.x.x:3888
java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
I'm new to zookeeper. I had tried any ways i could find but it doesn't did the trick, maybe the reason is the cloud servers ? Hope someone can help me, please~~

Apache FTPSClient Cross OS Issue

My Windows 7 is providing FTP service using FileZilla Server. On the other hand, a Debian client would like to access the FTP server via Apache FTPsClient. The way I construct the client is shown below:
FTPSClient client = new FTPSClient("TLS", true);
client.setAuthValue(authValue);
client.configure(new FTPClientConfig(FTPClientConfig.SYST_UNIX));
client.connect("127.0.0.1", 990);
client.login("username", "password");
client.execPBSZ(0);
client.execPROT("P");
client.enterLocalPassiveMode();
With the above client on Windows, I can successfully retrieve a list of directory in my FTP server. The same client on Debian is however failed to connect to my Windows server. May anyone give me a hand? Many Thanks^^
The Debian client throws the following exception:
java.net.ConnectException: Connection timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at org.apache.commons.net.SocketClient.connect(SocketClient.java:188)
at org.apache.commons.net.SocketClient.connect(SocketClient.java:209)
while there is no log for the above connect event.
First of all, many thanks to Martin Prikryl.
Following setup guide, I've created a rule on Firewall allowing access on a port for normal FTP file transfer, but haven't for port 990. After creating new rule for port 990, everything works.
The setup guide for reference
http://www.howtogeek.com/140352/how-to-host-an-ftp-server-on-windows-with-filezilla/

JavaMail IMAP Connection Refused - Telnet works

I'm trying to use JavaMail in order to connect to an IMAP Server (on a remote virtual linux machine - Ubuntu 14 LTS) but I'm getting the following exception:
java.net.ConnectException: Connection refused
I've already tried to establish the connection via Telnet and everything works.
The JavaMail version I'm using is 1.5.5 (also tested with 1.4.7) and I'm using the following properties:
Properties properties = System.getProperties();
properties.setProperty("mail.imap.host", SERVER);
properties.setProperty("mail.store.protocol", "imap");
properties.put("mail.imap.port", PORT);
Session session = Session.getInstance(properties, null);
Store store = session.getStore("imap");
store.connect(USERNAME, PASSWORD);
Notes:
It's working on my personal machine
It's working on another external machine
It's failing on the remote linux virtual machine
The IMAP server is on a different machine - which is accessible to all of the previous
I've done some research and some people told that it could be a firewall/blocking issue but how am I able to connect via Telnet?
Thanks.
Edited
The telnet command I've applied in the test-run:
telnet <server_ip> <port>
After this, the connection is successfuly established and I'm able to apply IMAP commands such as list status.
The output from javamail when it fails is the following:
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:233)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189)
at com.sun.mail.iap.Protocol.<init>(Protocol.java:107)
at com.sun.mail.imap.protocol.IMAPProtocol.<init>(IMAPProtocol.java:104)
at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:538)
... 12 more
Firewalls usually work port based. This means telnet (23/TCP) can be allowed whereas IMAP (usually 143/993) is blocked.
You should check the firewall and check if the IMAP port is open.
Where is your program running? If you change getDefaultInstance to getInstance does it work?
I've found a solution!!
I performed a network capture on the remote machine and I saw that for some reason the javamail api was using the default IMAP folder and not the one I've selected..
Further tests revealed that changing the property value type to String instead of Integer solved this issue. It's important to notice that this didn't happen on other environments so I'm not sure the reason I had to make this change.

SQLServer - SQLServerException with jdbc access

I have installed on my pc ms sqlserver express 2012, I am trying to reach it via jdbc but I am not successfull, I get the error:
com.microsoft.sqlserver.jdbc.SQLServerException: connection to the host localhost, port 1433 has failed. Error:
"Connection refused: connect. Verify the connection properties.
Make sure that an instance of SQL Server is running on the host
and accepting TCP/IP connections at the port. Make sure that TCP
connections to the port are not blocked by a firewall
I am accessing via the following url: "jdbc:sqlserver://localhost:1433;database=mytest;"
I enabled the tcp/ip via the Sql server configuration manager, but if I run netstat-an I can't see the 1433 port listening.
I disabled windows firewall too...
I am lost :(
Any help?
Thank you!
****UPDATE**
I could overcome the problem by enabling port 1433 on IpAll under Sql Server configuration manager - Sql Server Network configuration - Protocols for SQLEXPRESS - tcp-ip Properties - Ip Addresses. But now I get another error:com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'sa'. ClientConnectionId
Any ideas? thanks!
The answer for the error:
com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'sa'. ClientConnectionId
is:
Go to Object explorer, click on properties (right click on Sql Server name), and on the security tab click on Sql Server and Windows authentication mode.
This worked for me.

NoRouteToHostException on client or server?

I am getting
Caused by: java.net.NoRouteToHostException: No route to host
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:564)
at sun.reflect.GeneratedMethodAccessor638.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:140)
at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:130)
at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
javadoc says
Signals that an error occurred while attempting to connect a socket to
a remote address and port. Typically, the remote host cannot be
reached because of an intervening firewall, or if an intermediate
router is down.
Is this error on client side or remote side or it can be either of these?
Basically it says that your client cannot connect to the server due to the address is inaccessible from the client machine.
Please check that the address you are connecting to is accessible, either via ping command in your Command Prompt (Windows) or terminal (Unix-based):
ping <address>
or if it's a web server you can try to check it in your web browser.
The ping command is helpful for me in most cases, since I would know why exactly I can't connect to the address. It can be a mistyped address or like the javadoc suggests, problem with firewall.
Either. It could be a firewall on the client machine blocking outgoing calls or somewhere at the other end.
It may be possible the ping will provide responses, but the application may still fail to connect.
If that is the case, I would suggest using telnet to try and connect to the host using the desired port, telnet host.address port
If the connection is refused then the port on the host will need to be allowed. It that succeeds, but the application still won't connect:
Verify the address:port being used in your application are the same as those used in the telnet test.
It may be a local port on the client blocking the connection, in which case you would need to allow the port on the client
In my case it was solved like this:
1 - Clear the cache with 'yarn cache clean' or 'npm cache clean --force'
2 - after that reboot the pc.
If you clear the cache but do not reboot, the data will still be stored 'somewhere' on the network, so the port will not connect, it is still busy.
After restarting it connects smoothly.
I hope I was helpful!
I had the same issue, and resolve it by disabling the firewall on both sides :
systemctl disable firewalld
service firewalld stop
I had the same issue, I did run iptables flush on host server, this fixed the issue.
# iptables --flush

Categories

Resources