Replies: 2 comments 3 replies
-
In Sign&Encrpt mode, Client don't send "CreateSessionReqeuest" to Server. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Maybe a Wireshark capture would help to understand? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using eclipse milo version 0.3.6
And OPC UA Server is KEPServerEX6
This is the KEPServerEX6 Configuration.
And This is the OPC UA Client Code.
** KeyStoreLoader.java
`/*
*/
package com.sit.stdplf.aqst.agent.opcua01.milo.util;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.security.Key;
import java.security.KeyPair;
import java.security.KeyStore;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.cert.X509Certificate;
import java.util.regex.Pattern;
import org.eclipse.milo.opcua.sdk.server.util.HostnameUtil;
import org.eclipse.milo.opcua.stack.core.util.SelfSignedCertificateBuilder;
import org.eclipse.milo.opcua.stack.core.util.SelfSignedCertificateGenerator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.sit.stdplf.aqst.agent.opcua01.common.config.Props;
import com.sit.stdplf.aqst.agent.opcua01.common.constant.Consts;
public class KeyStoreLoader
{
private static Logger LOGGER = LoggerFactory.getLogger ( Consts.LOGGER_NAME );
}
`
** OPCClient.java
`package com.sit.stdplf.aqst.agent.opcua01.milo;
import java.io.File;
import java.net.URI;
import java.util.List;
import org.eclipse.milo.opcua.sdk.client.OpcUaClient;
import org.eclipse.milo.opcua.sdk.client.api.config.OpcUaClientConfig;
import org.eclipse.milo.opcua.sdk.client.api.identity.AnonymousProvider;
import org.eclipse.milo.opcua.sdk.client.api.identity.UsernameProvider;
import org.eclipse.milo.opcua.stack.client.DiscoveryClient;
import org.eclipse.milo.opcua.stack.core.channel.MessageLimits;
import org.eclipse.milo.opcua.stack.core.security.SecurityPolicy;
import org.eclipse.milo.opcua.stack.core.types.builtin.LocalizedText;
import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger;
import org.eclipse.milo.opcua.stack.core.types.structured.EndpointDescription;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.sit.stdplf.aqst.agent.opcua01.common.config.Props;
import com.sit.stdplf.aqst.agent.opcua01.common.constant.Consts;
import com.sit.stdplf.aqst.agent.opcua01.common.constant.ErrCds;
import com.sit.stdplf.aqst.agent.opcua01.common.message.LangMessage;
import com.sit.stdplf.aqst.agent.opcua01.milo.util.KeyStoreLoader;
import com.sit.stdplf.base.common.config.BaseProps;
import com.sit.stdplf.base.common.constant.BaseConsts;
import com.sit.stdplf.base.logmgt.exception.SPExceptionHandler;
import com.sit.stdplf.base.logmgt.exception.network.SPNetworkException;
import com.sit.stdplf.commons.util.LogMsgUtil;
public class OPCClient
{
private static final Logger LOGGER = LoggerFactory.getLogger ( Consts.LOGGER_NAME );
}
`
If I set KEPServerEx6 securitymode to Sign. It works well.
But If I set that to Sign and Encrypt mode, OPC Client can't connect to Server.
This is the error log.
It there any problem in my code?
Beta Was this translation helpful? Give feedback.
All reactions