Anonymous_User Absent Member.
Absent Member.
4364 views

SOAP communication using SSL

Hello

All big companies open SOAP port only when using SSL

This means that my programm MUST be able to use SSL

I would hope that this is simply setting one more switch when starting
communication with SOAP !

Sou i jost add this string
if (Settings[GlobalVars.gw_srv_ssl].Equals("1")) { str =
"https://"; } else { str = "http://"; }


i'm used

public bool LoginToGW(string GWName1, string GWUser1, string GWPort1,
string GWPass1)
{//if (LoginToGW(GWName,GWUser,GWPort,GWPass)
ws = null;

String str = "";
GWReference.loginRequest req = new
GWReference.loginRequest();
GWReference.loginResponse resp;
GWReference.PlainText pt = new GWReference.PlainText();

ws = new GWReference.GroupWiseBinding();


if (Settings[GlobalVars.gw_srv_ssl].Equals("1")) { str =
"https://"; } else { str = "http://"; }
str += GWName1;
str += ":";
str += GWPort1;

str += "/soap";

ws.Url = str;

pt.username = GWUser1;
pt.password = GWPass1;
req.auth = pt;

try
{
resp = ws.loginRequest(req);

if (0 == resp.status.code)
{
ws.session = new GWReference.@string();
ws.session.Text = new String[1];
ws.session.Text[0] = resp.session;
ws = null;
return true;

}
}
catch (Exception e)
{
msgStatus = e.Message;
ws = null;
}
}

But after resp = ws.loginRequest(req); i resive Exception
"The underlying connection was closed: Could not establish trust
relationship for the SSL/TLS secure channel."

Can you help me???


Kirill
Labels (1)
0 Likes
13 Replies
Anonymous_User Absent Member.
Absent Member.

Re: SOAP communication using SSL


Hey Krill,

in Java I needed to disable client side certificate checking.
As most companies don't use Ver*S*gn trused certs for
their internal servers... ( i.e. the POA cert is self signed, thus not trust
worthy )

Ray.

"Kirill" <Kirill@skypro.ch> schrieb im Newsbeitrag
news:t8po741gooottnuanvjhf8l1usko0dkvs2@4ax.com...
> Hello
>
> All big companies open SOAP port only when using SSL
>
> This means that my programm MUST be able to use SSL
>
> I would hope that this is simply setting one more switch when starting
> communication with SOAP !
>
> Sou i jost add this string
> if (Settings[GlobalVars.gw_srv_ssl].Equals("1")) { str =
> "https://"; } else { str = "http://"; }
>
>
> i'm used
>
> public bool LoginToGW(string GWName1, string GWUser1, string GWPort1,
> string GWPass1)
> {//if (LoginToGW(GWName,GWUser,GWPort,GWPass)
> ws = null;
>
> String str = "";
> GWReference.loginRequest req = new
> GWReference.loginRequest();
> GWReference.loginResponse resp;
> GWReference.PlainText pt = new GWReference.PlainText();
>
> ws = new GWReference.GroupWiseBinding();
>
>
> if (Settings[GlobalVars.gw_srv_ssl].Equals("1")) { str =
> "https://"; } else { str = "http://"; }
> str += GWName1;
> str += ":";
> str += GWPort1;
>
> str += "/soap";
>
> ws.Url = str;
>
> pt.username = GWUser1;
> pt.password = GWPass1;
> req.auth = pt;
>
> try
> {
> resp = ws.loginRequest(req);
>
> if (0 == resp.status.code)
> {
> ws.session = new GWReference.@string();
> ws.session.Text = new String[1];
> ws.session.Text[0] = resp.session;
> ws = null;
> return true;
>
> }
> }
> catch (Exception e)
> {
> msgStatus = e.Message;
> ws = null;
> }
> }
>
> But after resp = ws.loginRequest(req); i resive Exception
> "The underlying connection was closed: Could not establish trust
> relationship for the SSL/TLS secure channel."
>
> Can you help me???
>
>
> Kirill



0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: SOAP communication using SSL




Hi Rey

How you disable on client side certificate checking.

Kirill


>
>Hey Krill,
>
>in Java I needed to disable client side certificate checking.
>As most companies don't use Ver*S*gn trused certs for
>their internal servers... ( i.e. the POA cert is self signed, thus not trust
>worthy )
>
>Ray.
>
>"Kirill" <Kirill@skypro.ch> schrieb im Newsbeitrag
>news:t8po741gooottnuanvjhf8l1usko0dkvs2@4ax.com...
>> Hello
>>
>> All big companies open SOAP port only when using SSL
>>
>> This means that my programm MUST be able to use SSL
>>
>> I would hope that this is simply setting one more switch when starting
>> communication with SOAP !
>>
>> Sou i jost add this string
>> if (Settings[GlobalVars.gw_srv_ssl].Equals("1")) { str =
>> "https://"; } else { str = "http://"; }
>>
>>
>> i'm used
>>
>> public bool LoginToGW(string GWName1, string GWUser1, string GWPort1,
>> string GWPass1)
>> {//if (LoginToGW(GWName,GWUser,GWPort,GWPass)
>> ws = null;
>>
>> String str = "";
>> GWReference.loginRequest req = new
>> GWReference.loginRequest();
>> GWReference.loginResponse resp;
>> GWReference.PlainText pt = new GWReference.PlainText();
>>
>> ws = new GWReference.GroupWiseBinding();
>>
>>
>> if (Settings[GlobalVars.gw_srv_ssl].Equals("1")) { str =
>> "https://"; } else { str = "http://"; }
>> str += GWName1;
>> str += ":";
>> str += GWPort1;
>>
>> str += "/soap";
>>
>> ws.Url = str;
>>
>> pt.username = GWUser1;
>> pt.password = GWPass1;
>> req.auth = pt;
>>
>> try
>> {
>> resp = ws.loginRequest(req);
>>
>> if (0 == resp.status.code)
>> {
>> ws.session = new GWReference.@string();
>> ws.session.Text = new String[1];
>> ws.session.Text[0] = resp.session;
>> ws = null;
>> return true;
>>
>> }
>> }
>> catch (Exception e)
>> {
>> msgStatus = e.Message;
>> ws = null;
>> }
>> }
>>
>> But after resp = ws.loginRequest(req); i resive Exception
>> "The underlying connection was closed: Could not establish trust
>> relationship for the SSL/TLS secure channel."
>>
>> Can you help me???
>>
>>
>> Kirill

>

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: SOAP communication using SSL

I'm not sure if the javaClient from the SOAP SDK has this example.
I've attached what we do for SSL. When we try SSL, it the user
hasn't seen the certificate before, we prompt them if they want
to accept the certificate. If they accept the certificate, we don't
prompt them any more for that certificate. Let me know if you
have questions.

I've posted the source out to:
ftp://ftp.novell.com/outgoing/ssl.zip

Let me know if you have questions.
Preston

>>> On Tuesday, July 15, 2008 at 6:11 AM, Ray<ray@test.de> wrote:


> Hey Krill,
>
> in Java I needed to disable client side certificate checking.
> As most companies don't use Ver*S*gn trused certs for
> their internal servers... ( i.e. the POA cert is self signed, thus not

trust
>
> worthy )
>
> Ray.
>
> "Kirill" <Kirill@skypro.ch> schrieb im Newsbeitrag
> news:t8po741gooottnuanvjhf8l1usko0dkvs2@4ax.com...
>> Hello
>>
>> All big companies open SOAP port only when using SSL
>>
>> This means that my programm MUST be able to use SSL
>>
>> I would hope that this is simply setting one more switch when starting
>> communication with SOAP !
>>
>> Sou i jost add this string
>> if (Settings[GlobalVars.gw_srv_ssl].Equals("1")) { str =
>> "https://"; } else { str = "http://"; }
>>
>>
>> i'm used
>>
>> public bool LoginToGW(string GWName1, string GWUser1, string GWPort1,
>> string GWPass1)
>> {//if (LoginToGW(GWName,GWUser,GWPort,GWPass)
>> ws = null;
>>
>> String str = "";
>> GWReference.loginRequest req = new
>> GWReference.loginRequest();
>> GWReference.loginResponse resp;
>> GWReference.PlainText pt = new GWReference.PlainText();
>>
>> ws = new GWReference.GroupWiseBinding();
>>
>>
>> if (Settings[GlobalVars.gw_srv_ssl].Equals("1")) { str =
>> "https://"; } else { str = "http://"; }
>> str += GWName1;
>> str += ":";
>> str += GWPort1;
>>
>> str += "/soap";
>>
>> ws.Url = str;
>>
>> pt.username = GWUser1;
>> pt.password = GWPass1;
>> req.auth = pt;
>>
>> try
>> {
>> resp = ws.loginRequest(req);
>>
>> if (0 == resp.status.code)
>> {
>> ws.session = new GWReference.@string();
>> ws.session.Text = new String[1];
>> ws.session.Text[0] = resp.session;
>> ws = null;
>> return true;
>>
>> }
>> }
>> catch (Exception e)
>> {
>> msgStatus = e.Message;
>> ws = null;
>> }
>> }
>>
>> But after resp = ws.loginRequest(req); i resive Exception
>> "The underlying connection was closed: Could not establish trust
>> relationship for the SSL/TLS secure channel."
>>
>> Can you help me???
>>
>>
>> Kirill

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: SOAP communication using SSL

Hello Preston

java its good
But me need code in C#

Like i understood me need rewrite this part of code


if ( null == SSLFactory ) {
SSLContext ctx;
MyHostNameVerifier hv = new
MyHostNameVerifier();
MyTrustManager tm = new
MyTrustManager();
TrustManager mytm[] = { tm };

ctx = SSLContext.getInstance( "SSL" );

ctx.init( null, mytm, null );
SSLFactory = ctx.getSocketFactory();
HttpsURLConnection.setDefaultSSLSocketFactory(
SSLFactory );
HttpsURLConnection.setDefaultHostnameVerifier( hv );
}


but i can't find meny Lib for this in C#

Meby you have exaples for C#?

Kirill


On Tue, 15 Jul 2008 18:09:20 GMT, "Preston Stephenson"
<PStephenson@gw.novell.com> wrote:

>I'm not sure if the javaClient from the SOAP SDK has this example.
>I've attached what we do for SSL. When we try SSL, it the user
>hasn't seen the certificate before, we prompt them if they want
>to accept the certificate. If they accept the certificate, we don't
>prompt them any more for that certificate. Let me know if you
>have questions.
>
>I've posted the source out to:
>ftp://ftp.novell.com/outgoing/ssl.zip
>
>Let me know if you have questions.
>Preston
>
>>>> On Tuesday, July 15, 2008 at 6:11 AM, Ray<ray@test.de> wrote:

>
>> Hey Krill,
>>
>> in Java I needed to disable client side certificate checking.
>> As most companies don't use Ver*S*gn trused certs for
>> their internal servers... ( i.e. the POA cert is self signed, thus not

>trust
>>
>> worthy )
>>
>> Ray.
>>
>> "Kirill" <Kirill@skypro.ch> schrieb im Newsbeitrag
>> news:t8po741gooottnuanvjhf8l1usko0dkvs2@4ax.com...
>>> Hello
>>>
>>> All big companies open SOAP port only when using SSL
>>>
>>> This means that my programm MUST be able to use SSL
>>>
>>> I would hope that this is simply setting one more switch when starting
>>> communication with SOAP !
>>>
>>> Sou i jost add this string
>>> if (Settings[GlobalVars.gw_srv_ssl].Equals("1")) { str =
>>> "https://"; } else { str = "http://"; }
>>>
>>>
>>> i'm used
>>>
>>> public bool LoginToGW(string GWName1, string GWUser1, string GWPort1,
>>> string GWPass1)
>>> {//if (LoginToGW(GWName,GWUser,GWPort,GWPass)
>>> ws = null;
>>>
>>> String str = "";
>>> GWReference.loginRequest req = new
>>> GWReference.loginRequest();
>>> GWReference.loginResponse resp;
>>> GWReference.PlainText pt = new GWReference.PlainText();
>>>
>>> ws = new GWReference.GroupWiseBinding();
>>>
>>>
>>> if (Settings[GlobalVars.gw_srv_ssl].Equals("1")) { str =
>>> "https://"; } else { str = "http://"; }
>>> str += GWName1;
>>> str += ":";
>>> str += GWPort1;
>>>
>>> str += "/soap";
>>>
>>> ws.Url = str;
>>>
>>> pt.username = GWUser1;
>>> pt.password = GWPass1;
>>> req.auth = pt;
>>>
>>> try
>>> {
>>> resp = ws.loginRequest(req);
>>>
>>> if (0 == resp.status.code)
>>> {
>>> ws.session = new GWReference.@string();
>>> ws.session.Text = new String[1];
>>> ws.session.Text[0] = resp.session;
>>> ws = null;
>>> return true;
>>>
>>> }
>>> }
>>> catch (Exception e)
>>> {
>>> msgStatus = e.Message;
>>> ws = null;
>>> }
>>> }
>>>
>>> But after resp = ws.loginRequest(req); i resive Exception
>>> "The underlying connection was closed: Could not establish trust
>>> relationship for the SSL/TLS secure channel."
>>>
>>> Can you help me???
>>>
>>>
>>> Kirill

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: SOAP communication using SSL

I've copied some test code to:
ftp://ftp.novell.com/outgoing/vcsClient.zip

It needs some work. It prompted me twice for the certificate.

Preston

>>> On Wednesday, July 16, 2008 at 3:53 AM, Kirill<Kirill@skypro.ch> wrote:

> Hello Preston
>
> java its good
> But me need code in C#
>
> Like i understood me need rewrite this part of code
>
>
> if ( null == SSLFactory ) {
> SSLContext ctx;
> MyHostNameVerifier hv = new
> MyHostNameVerifier();
> MyTrustManager tm = new
> MyTrustManager();
> TrustManager mytm[] = { tm };
>
> ctx = SSLContext.getInstance( "SSL" );
>
> ctx.init( null, mytm, null );
> SSLFactory = ctx.getSocketFactory();
> HttpsURLConnection.setDefaultSSLSocketFactory(
> SSLFactory );
> HttpsURLConnection.setDefaultHostnameVerifier( hv );
> }
>
>
> but i can't find meny Lib for this in C#
>
> Meby you have exaples for C#?
>
> Kirill
>
>
> On Tue, 15 Jul 2008 18:09:20 GMT, "Preston Stephenson"
> <PStephenson@gw.novell.com> wrote:
>
>>I'm not sure if the javaClient from the SOAP SDK has this example.
>>I've attached what we do for SSL. When we try SSL, it the user
>>hasn't seen the certificate before, we prompt them if they want
>>to accept the certificate. If they accept the certificate, we don't
>>prompt them any more for that certificate. Let me know if you
>>have questions.
>>
>>I've posted the source out to:
>>ftp://ftp.novell.com/outgoing/ssl.zip
>>
>>Let me know if you have questions.
>>Preston
>>
>>>>> On Tuesday, July 15, 2008 at 6:11 AM, Ray<ray@test.de> wrote:

>>
>>> Hey Krill,
>>>
>>> in Java I needed to disable client side certificate checking.
>>> As most companies don't use Ver*S*gn trused certs for
>>> their internal servers... ( i.e. the POA cert is self signed, thus not

>>trust
>>>
>>> worthy )
>>>
>>> Ray.
>>>
>>> "Kirill" <Kirill@skypro.ch> schrieb im Newsbeitrag
>>> news:t8po741gooottnuanvjhf8l1usko0dkvs2@4ax.com...
>>>> Hello
>>>>
>>>> All big companies open SOAP port only when using SSL
>>>>
>>>> This means that my programm MUST be able to use SSL
>>>>
>>>> I would hope that this is simply setting one more switch when starting
>>>> communication with SOAP !
>>>>
>>>> Sou i jost add this string
>>>> if (Settings[GlobalVars.gw_srv_ssl].Equals("1")) { str =
>>>> "https://"; } else { str = "http://"; }
>>>>
>>>>
>>>> i'm used
>>>>
>>>> public bool LoginToGW(string GWName1, string GWUser1, string GWPort1,
>>>> string GWPass1)
>>>> {//if (LoginToGW(GWName,GWUser,GWPort,GWPass)
>>>> ws = null;
>>>>
>>>> String str = "";
>>>> GWReference.loginRequest req = new
>>>> GWReference.loginRequest();
>>>> GWReference.loginResponse resp;
>>>> GWReference.PlainText pt = new GWReference.PlainText();
>>>>
>>>> ws = new GWReference.GroupWiseBinding();
>>>>
>>>>
>>>> if (Settings[GlobalVars.gw_srv_ssl].Equals("1")) { str =
>>>> "https://"; } else { str = "http://"; }
>>>> str += GWName1;
>>>> str += ":";
>>>> str += GWPort1;
>>>>
>>>> str += "/soap";
>>>>
>>>> ws.Url = str;
>>>>
>>>> pt.username = GWUser1;
>>>> pt.password = GWPass1;
>>>> req.auth = pt;
>>>>
>>>> try
>>>> {
>>>> resp = ws.loginRequest(req);
>>>>
>>>> if (0 == resp.status.code)
>>>> {
>>>> ws.session = new GWReference.@string();
>>>> ws.session.Text = new String[1];
>>>> ws.session.Text[0] = resp.session;
>>>> ws = null;
>>>> return true;
>>>>
>>>> }
>>>> }
>>>> catch (Exception e)
>>>> {
>>>> msgStatus = e.Message;
>>>> ws = null;
>>>> }
>>>> }
>>>>
>>>> But after resp = ws.loginRequest(req); i resive Exception
>>>> "The underlying connection was closed: Could not establish trust
>>>> relationship for the SSL/TLS secure channel."
>>>>
>>>> Can you help me???
>>>>
>>>>
>>>> Kirill

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: SOAP communication using SSL

Thx Preston

Its work
But all time ask new certificate And don't save previus



On Wed, 16 Jul 2008 12:45:51 GMT, "Preston Stephenson"
<PStephenson@gw.novell.com> wrote:

>I've copied some test code to:
>ftp://ftp.novell.com/outgoing/vcsClient.zip
>
>It needs some work. It prompted me twice for the certificate.
>
>Preston
>
>>>> On Wednesday, July 16, 2008 at 3:53 AM, Kirill<Kirill@skypro.ch> wrote:

>> Hello Preston
>>
>> java its good
>> But me need code in C#
>>
>> Like i understood me need rewrite this part of code
>>
>>
>> if ( null == SSLFactory ) {
>> SSLContext ctx;
>> MyHostNameVerifier hv = new
>> MyHostNameVerifier();
>> MyTrustManager tm = new
>> MyTrustManager();
>> TrustManager mytm[] = { tm };
>>
>> ctx = SSLContext.getInstance( "SSL" );
>>
>> ctx.init( null, mytm, null );
>> SSLFactory = ctx.getSocketFactory();
>> HttpsURLConnection.setDefaultSSLSocketFactory(
>> SSLFactory );
>> HttpsURLConnection.setDefaultHostnameVerifier( hv );
>> }
>>
>>
>> but i can't find meny Lib for this in C#
>>
>> Meby you have exaples for C#?
>>
>> Kirill
>>
>>
>> On Tue, 15 Jul 2008 18:09:20 GMT, "Preston Stephenson"
>> <PStephenson@gw.novell.com> wrote:
>>
>>>I'm not sure if the javaClient from the SOAP SDK has this example.
>>>I've attached what we do for SSL. When we try SSL, it the user
>>>hasn't seen the certificate before, we prompt them if they want
>>>to accept the certificate. If they accept the certificate, we don't
>>>prompt them any more for that certificate. Let me know if you
>>>have questions.
>>>
>>>I've posted the source out to:
>>>ftp://ftp.novell.com/outgoing/ssl.zip
>>>
>>>Let me know if you have questions.
>>>Preston
>>>
>>>>>> On Tuesday, July 15, 2008 at 6:11 AM, Ray<ray@test.de> wrote:
>>>
>>>> Hey Krill,
>>>>
>>>> in Java I needed to disable client side certificate checking.
>>>> As most companies don't use Ver*S*gn trused certs for
>>>> their internal servers... ( i.e. the POA cert is self signed, thus not
>>>trust
>>>>
>>>> worthy )
>>>>
>>>> Ray.
>>>>
>>>> "Kirill" <Kirill@skypro.ch> schrieb im Newsbeitrag
>>>> news:t8po741gooottnuanvjhf8l1usko0dkvs2@4ax.com...
>>>>> Hello
>>>>>
>>>>> All big companies open SOAP port only when using SSL
>>>>>
>>>>> This means that my programm MUST be able to use SSL
>>>>>
>>>>> I would hope that this is simply setting one more switch when starting
>>>>> communication with SOAP !
>>>>>
>>>>> Sou i jost add this string
>>>>> if (Settings[GlobalVars.gw_srv_ssl].Equals("1")) { str =
>>>>> "https://"; } else { str = "http://"; }
>>>>>
>>>>>
>>>>> i'm used
>>>>>
>>>>> public bool LoginToGW(string GWName1, string GWUser1, string GWPort1,
>>>>> string GWPass1)
>>>>> {//if (LoginToGW(GWName,GWUser,GWPort,GWPass)
>>>>> ws = null;
>>>>>
>>>>> String str = "";
>>>>> GWReference.loginRequest req = new
>>>>> GWReference.loginRequest();
>>>>> GWReference.loginResponse resp;
>>>>> GWReference.PlainText pt = new GWReference.PlainText();
>>>>>
>>>>> ws = new GWReference.GroupWiseBinding();
>>>>>
>>>>>
>>>>> if (Settings[GlobalVars.gw_srv_ssl].Equals("1")) { str =
>>>>> "https://"; } else { str = "http://"; }
>>>>> str += GWName1;
>>>>> str += ":";
>>>>> str += GWPort1;
>>>>>
>>>>> str += "/soap";
>>>>>
>>>>> ws.Url = str;
>>>>>
>>>>> pt.username = GWUser1;
>>>>> pt.password = GWPass1;
>>>>> req.auth = pt;
>>>>>
>>>>> try
>>>>> {
>>>>> resp = ws.loginRequest(req);
>>>>>
>>>>> if (0 == resp.status.code)
>>>>> {
>>>>> ws.session = new GWReference.@string();
>>>>> ws.session.Text = new String[1];
>>>>> ws.session.Text[0] = resp.session;
>>>>> ws = null;
>>>>> return true;
>>>>>
>>>>> }
>>>>> }
>>>>> catch (Exception e)
>>>>> {
>>>>> msgStatus = e.Message;
>>>>> ws = null;
>>>>> }
>>>>> }
>>>>>
>>>>> But after resp = ws.loginRequest(req); i resive Exception
>>>>> "The underlying connection was closed: Could not establish trust
>>>>> relationship for the SSL/TLS secure channel."
>>>>>
>>>>> Can you help me???
>>>>>
>>>>>
>>>>> Kirill

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: SOAP communication using SSL

Kirill wrote:
> Thx Preston
>
> Its work
> But all time ask new certificate And don't save previus
>
>
>
> On Wed, 16 Jul 2008 12:45:51 GMT, "Preston Stephenson"
> <PStephenson@gw.novell.com> wrote:
>
>> I've copied some test code to:
>> ftp://ftp.novell.com/outgoing/vcsClient.zip
>>
>> It needs some work. It prompted me twice for the certificate.
>>
>> Preston
>>
>>>>> On Wednesday, July 16, 2008 at 3:53 AM, Kirill<Kirill@skypro.ch> wrote:
>>> Hello Preston
>>>
>>> java its good
>>> But me need code in C#
>>>
>>> Like i understood me need rewrite this part of code
>>>
>>>
>>> if ( null == SSLFactory ) {
>>> SSLContext ctx;
>>> MyHostNameVerifier hv = new
>>> MyHostNameVerifier();
>>> MyTrustManager tm = new
>>> MyTrustManager();
>>> TrustManager mytm[] = { tm };
>>>
>>> ctx = SSLContext.getInstance( "SSL" );
>>>
>>> ctx.init( null, mytm, null );
>>> SSLFactory = ctx.getSocketFactory();
>>> HttpsURLConnection.setDefaultSSLSocketFactory(
>>> SSLFactory );
>>> HttpsURLConnection.setDefaultHostnameVerifier( hv );
>>> }
>>>
>>>
>>> but i can't find meny Lib for this in C#
>>>
>>> Meby you have exaples for C#?
>>>
>>> Kirill
>>>
>>>
>>> On Tue, 15 Jul 2008 18:09:20 GMT, "Preston Stephenson"
>>> <PStephenson@gw.novell.com> wrote:
>>>
>>>> I'm not sure if the javaClient from the SOAP SDK has this example.
>>>> I've attached what we do for SSL. When we try SSL, it the user
>>>> hasn't seen the certificate before, we prompt them if they want
>>>> to accept the certificate. If they accept the certificate, we don't
>>>> prompt them any more for that certificate. Let me know if you
>>>> have questions.
>>>>
>>>> I've posted the source out to:
>>>> ftp://ftp.novell.com/outgoing/ssl.zip
>>>>
>>>> Let me know if you have questions.
>>>> Preston
>>>>
>>>>>>> On Tuesday, July 15, 2008 at 6:11 AM, Ray<ray@test.de> wrote:
>>>>> Hey Krill,
>>>>>
>>>>> in Java I needed to disable client side certificate checking.
>>>>> As most companies don't use Ver*S*gn trused certs for
>>>>> their internal servers... ( i.e. the POA cert is self signed, thus not
>>>> trust
>>>>> worthy )
>>>>>
>>>>> Ray.
>>>>>
>>>>> "Kirill" <Kirill@skypro.ch> schrieb im Newsbeitrag
>>>>> news:t8po741gooottnuanvjhf8l1usko0dkvs2@4ax.com...
>>>>>> Hello
>>>>>>
>>>>>> All big companies open SOAP port only when using SSL
>>>>>>
>>>>>> This means that my programm MUST be able to use SSL
>>>>>>
>>>>>> I would hope that this is simply setting one more switch when starting
>>>>>> communication with SOAP !
>>>>>>
>>>>>> Sou i jost add this string
>>>>>> if (Settings[GlobalVars.gw_srv_ssl].Equals("1")) { str =
>>>>>> "https://"; } else { str = "http://"; }
>>>>>>
>>>>>>
>>>>>> i'm used
>>>>>>
>>>>>> public bool LoginToGW(string GWName1, string GWUser1, string GWPort1,
>>>>>> string GWPass1)
>>>>>> {//if (LoginToGW(GWName,GWUser,GWPort,GWPass)
>>>>>> ws = null;
>>>>>>
>>>>>> String str = "";
>>>>>> GWReference.loginRequest req = new
>>>>>> GWReference.loginRequest();
>>>>>> GWReference.loginResponse resp;
>>>>>> GWReference.PlainText pt = new GWReference.PlainText();
>>>>>>
>>>>>> ws = new GWReference.GroupWiseBinding();
>>>>>>
>>>>>>
>>>>>> if (Settings[GlobalVars.gw_srv_ssl].Equals("1")) { str =
>>>>>> "https://"; } else { str = "http://"; }
>>>>>> str += GWName1;
>>>>>> str += ":";
>>>>>> str += GWPort1;
>>>>>>
>>>>>> str += "/soap";
>>>>>>
>>>>>> ws.Url = str;
>>>>>>
>>>>>> pt.username = GWUser1;
>>>>>> pt.password = GWPass1;
>>>>>> req.auth = pt;
>>>>>>
>>>>>> try
>>>>>> {
>>>>>> resp = ws.loginRequest(req);
>>>>>>
>>>>>> if (0 == resp.status.code)
>>>>>> {
>>>>>> ws.session = new GWReference.@string();
>>>>>> ws.session.Text = new String[1];
>>>>>> ws.session.Text[0] = resp.session;
>>>>>> ws = null;
>>>>>> return true;
>>>>>>
>>>>>> }
>>>>>> }
>>>>>> catch (Exception e)
>>>>>> {
>>>>>> msgStatus = e.Message;
>>>>>> ws = null;
>>>>>> }
>>>>>> }
>>>>>>
>>>>>> But after resp = ws.loginRequest(req); i resive Exception
>>>>>> "The underlying connection was closed: Could not establish trust
>>>>>> relationship for the SSL/TLS secure channel."
>>>>>>
>>>>>> Can you help me???
>>>>>>
>>>>>>
>>>>>> Kirill


Kiril - asking how to do an unproteted SSL connection, is I am sure,
adequaely covered in 1000s of .NET articles.
0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: SOAP communication using SSL


I find problem need jost replase
tmp == cert
to
tmp.ToString() == cert.ToString()

then all ok

Tnx Agein Preston

bb

<PStephenson@gw.novell.com> wrote:

>I've copied some test code to:
>ftp://ftp.novell.com/outgoing/vcsClient.zip
>
>It needs some work. It prompted me twice for the certificate.
>
>Preston
>
>>>> On Wednesday, July 16, 2008 at 3:53 AM, Kirill<Kirill@skypro.ch> wrote:

>> Hello Preston
>>
>> java its good
>> But me need code in C#
>>
>> Like i understood me need rewrite this part of code
>>
>>
>> if ( null == SSLFactory ) {
>> SSLContext ctx;
>> MyHostNameVerifier hv = new
>> MyHostNameVerifier();
>> MyTrustManager tm = new
>> MyTrustManager();
>> TrustManager mytm[] = { tm };
>>
>> ctx = SSLContext.getInstance( "SSL" );
>>
>> ctx.init( null, mytm, null );
>> SSLFactory = ctx.getSocketFactory();
>> HttpsURLConnection.setDefaultSSLSocketFactory(
>> SSLFactory );
>> HttpsURLConnection.setDefaultHostnameVerifier( hv );
>> }
>>
>>
>> but i can't find meny Lib for this in C#
>>
>> Meby you have exaples for C#?
>>
>> Kirill
>>
>>
>> On Tue, 15 Jul 2008 18:09:20 GMT, "Preston Stephenson"
>> <PStephenson@gw.novell.com> wrote:
>>
>>>I'm not sure if the javaClient from the SOAP SDK has this example.
>>>I've attached what we do for SSL. When we try SSL, it the user
>>>hasn't seen the certificate before, we prompt them if they want
>>>to accept the certificate. If they accept the certificate, we don't
>>>prompt them any more for that certificate. Let me know if you
>>>have questions.
>>>
>>>I've posted the source out to:
>>>ftp://ftp.novell.com/outgoing/ssl.zip
>>>
>>>Let me know if you have questions.
>>>Preston
>>>
>>>>>> On Tuesday, July 15, 2008 at 6:11 AM, Ray<ray@test.de> wrote:
>>>
>>>> Hey Krill,
>>>>
>>>> in Java I needed to disable client side certificate checking.
>>>> As most companies don't use Ver*S*gn trused certs for
>>>> their internal servers... ( i.e. the POA cert is self signed, thus not
>>>trust
>>>>
>>>> worthy )
>>>>
>>>> Ray.
>>>>
>>>> "Kirill" <Kirill@skypro.ch> schrieb im Newsbeitrag
>>>> news:t8po741gooottnuanvjhf8l1usko0dkvs2@4ax.com...
>>>>> Hello
>>>>>
>>>>> All big companies open SOAP port only when using SSL
>>>>>
>>>>> This means that my programm MUST be able to use SSL
>>>>>
>>>>> I would hope that this is simply setting one more switch when starting
>>>>> communication with SOAP !
>>>>>
>>>>> Sou i jost add this string
>>>>> if (Settings[GlobalVars.gw_srv_ssl].Equals("1")) { str =
>>>>> "https://"; } else { str = "http://"; }
>>>>>
>>>>>
>>>>> i'm used
>>>>>
>>>>> public bool LoginToGW(string GWName1, string GWUser1, string GWPort1,
>>>>> string GWPass1)
>>>>> {//if (LoginToGW(GWName,GWUser,GWPort,GWPass)
>>>>> ws = null;
>>>>>
>>>>> String str = "";
>>>>> GWReference.loginRequest req = new
>>>>> GWReference.loginRequest();
>>>>> GWReference.loginResponse resp;
>>>>> GWReference.PlainText pt = new GWReference.PlainText();
>>>>>
>>>>> ws = new GWReference.GroupWiseBinding();
>>>>>
>>>>>
>>>>> if (Settings[GlobalVars.gw_srv_ssl].Equals("1")) { str =
>>>>> "https://"; } else { str = "http://"; }
>>>>> str += GWName1;
>>>>> str += ":";
>>>>> str += GWPort1;
>>>>>
>>>>> str += "/soap";
>>>>>
>>>>> ws.Url = str;
>>>>>
>>>>> pt.username = GWUser1;
>>>>> pt.password = GWPass1;
>>>>> req.auth = pt;
>>>>>
>>>>> try
>>>>> {
>>>>> resp = ws.loginRequest(req);
>>>>>
>>>>> if (0 == resp.status.code)
>>>>> {
>>>>> ws.session = new GWReference.@string();
>>>>> ws.session.Text = new String[1];
>>>>> ws.session.Text[0] = resp.session;
>>>>> ws = null;
>>>>> return true;
>>>>>
>>>>> }
>>>>> }
>>>>> catch (Exception e)
>>>>> {
>>>>> msgStatus = e.Message;
>>>>> ws = null;
>>>>> }
>>>>> }
>>>>>
>>>>> But after resp = ws.loginRequest(req); i resive Exception
>>>>> "The underlying connection was closed: Could not establish trust
>>>>> relationship for the SSL/TLS secure channel."
>>>>>
>>>>> Can you help me???
>>>>>
>>>>>
>>>>> Kirill

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: SOAP communication using SSL

hi

I have question
How i can clear this SSL certificate
or where i can find him

Kirill

PS Clear SSL in IE settings don't help 😞












<PStephenson@gw.novell.com> wrote:

>I've copied some test code to:
>ftp://ftp.novell.com/outgoing/vcsClient.zip
>
>It needs some work. It prompted me twice for the certificate.
>
>Preston
>
>>>> On Wednesday, July 16, 2008 at 3:53 AM, Kirill<Kirill@skypro.ch> wrote:

>> Hello Preston
>>
>> java its good
>> But me need code in C#
>>
>> Like i understood me need rewrite this part of code
>>
>>
>> if ( null == SSLFactory ) {
>> SSLContext ctx;
>> MyHostNameVerifier hv = new
>> MyHostNameVerifier();
>> MyTrustManager tm = new
>> MyTrustManager();
>> TrustManager mytm[] = { tm };
>>
>> ctx = SSLContext.getInstance( "SSL" );
>>
>> ctx.init( null, mytm, null );
>> SSLFactory = ctx.getSocketFactory();
>> HttpsURLConnection.setDefaultSSLSocketFactory(
>> SSLFactory );
>> HttpsURLConnection.setDefaultHostnameVerifier( hv );
>> }
>>
>>
>> but i can't find meny Lib for this in C#
>>
>> Meby you have exaples for C#?
>>
>> Kirill
>>
>>
>> On Tue, 15 Jul 2008 18:09:20 GMT, "Preston Stephenson"
>> <PStephenson@gw.novell.com> wrote:
>>
>>>I'm not sure if the javaClient from the SOAP SDK has this example.
>>>I've attached what we do for SSL. When we try SSL, it the user
>>>hasn't seen the certificate before, we prompt them if they want
>>>to accept the certificate. If they accept the certificate, we don't
>>>prompt them any more for that certificate. Let me know if you
>>>have questions.
>>>
>>>I've posted the source out to:
>>>ftp://ftp.novell.com/outgoing/ssl.zip
>>>
>>>Let me know if you have questions.
>>>Preston
>>>
>>>>>> On Tuesday, July 15, 2008 at 6:11 AM, Ray<ray@test.de> wrote:
>>>
>>>> Hey Krill,
>>>>
>>>> in Java I needed to disable client side certificate checking.
>>>> As most companies don't use Ver*S*gn trused certs for
>>>> their internal servers... ( i.e. the POA cert is self signed, thus not
>>>trust
>>>>
>>>> worthy )
>>>>
>>>> Ray.
>>>>
>>>> "Kirill" <Kirill@skypro.ch> schrieb im Newsbeitrag
>>>> news:t8po741gooottnuanvjhf8l1usko0dkvs2@4ax.com...
>>>>> Hello
>>>>>
>>>>> All big companies open SOAP port only when using SSL
>>>>>
>>>>> This means that my programm MUST be able to use SSL
>>>>>
>>>>> I would hope that this is simply setting one more switch when starting
>>>>> communication with SOAP !
>>>>>
>>>>> Sou i jost add this string
>>>>> if (Settings[GlobalVars.gw_srv_ssl].Equals("1")) { str =
>>>>> "https://"; } else { str = "http://"; }
>>>>>
>>>>>
>>>>> i'm used
>>>>>
>>>>> public bool LoginToGW(string GWName1, string GWUser1, string GWPort1,
>>>>> string GWPass1)
>>>>> {//if (LoginToGW(GWName,GWUser,GWPort,GWPass)
>>>>> ws = null;
>>>>>
>>>>> String str = "";
>>>>> GWReference.loginRequest req = new
>>>>> GWReference.loginRequest();
>>>>> GWReference.loginResponse resp;
>>>>> GWReference.PlainText pt = new GWReference.PlainText();
>>>>>
>>>>> ws = new GWReference.GroupWiseBinding();
>>>>>
>>>>>
>>>>> if (Settings[GlobalVars.gw_srv_ssl].Equals("1")) { str =
>>>>> "https://"; } else { str = "http://"; }
>>>>> str += GWName1;
>>>>> str += ":";
>>>>> str += GWPort1;
>>>>>
>>>>> str += "/soap";
>>>>>
>>>>> ws.Url = str;
>>>>>
>>>>> pt.username = GWUser1;
>>>>> pt.password = GWPass1;
>>>>> req.auth = pt;
>>>>>
>>>>> try
>>>>> {
>>>>> resp = ws.loginRequest(req);
>>>>>
>>>>> if (0 == resp.status.code)
>>>>> {
>>>>> ws.session = new GWReference.@string();
>>>>> ws.session.Text = new String[1];
>>>>> ws.session.Text[0] = resp.session;
>>>>> ws = null;
>>>>> return true;
>>>>>
>>>>> }
>>>>> }
>>>>> catch (Exception e)
>>>>> {
>>>>> msgStatus = e.Message;
>>>>> ws = null;
>>>>> }
>>>>> }
>>>>>
>>>>> But after resp = ws.loginRequest(req); i resive Exception
>>>>> "The underlying connection was closed: Could not establish trust
>>>>> relationship for the SSL/TLS secure channel."
>>>>>
>>>>> Can you help me???
>>>>>
>>>>>
>>>>> Kirill

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: SOAP communication using SSL

I'm not sure. You need to clear it out of the keystore somehow.

Preston

>>> On Friday, July 25, 2008 at 8:37 AM, Kirill<Kirill@skypro.ch> wrote:

> hi
>
> I have question
> How i can clear this SSL certificate
> or where i can find him
>
> Kirill
>
> PS Clear SSL in IE settings don't help 😞
>
>
> <PStephenson@gw.novell.com> wrote:
>
>>I've copied some test code to:
>>ftp://ftp.novell.com/outgoing/vcsClient.zip
>>
>>It needs some work. It prompted me twice for the certificate.
>>
>>Preston
>>
>>>>> On Wednesday, July 16, 2008 at 3:53 AM, Kirill<Kirill@skypro.ch>

wrote:
>>> Hello Preston
>>>
>>> java its good
>>> But me need code in C#
>>>
>>> Like i understood me need rewrite this part of code
>>>
>>>
>>> if ( null == SSLFactory ) {
>>> SSLContext ctx;
>>> MyHostNameVerifier hv = new
>>> MyHostNameVerifier();
>>> MyTrustManager tm = new
>>> MyTrustManager();
>>> TrustManager mytm[] = { tm };
>>>
>>> ctx = SSLContext.getInstance( "SSL" );
>>>
>>> ctx.init( null, mytm, null );
>>> SSLFactory = ctx.getSocketFactory();
>>> HttpsURLConnection.setDefaultSSLSocketFactory(
>>> SSLFactory );
>>> HttpsURLConnection.setDefaultHostnameVerifier( hv );
>>> }
>>>
>>>
>>> but i can't find meny Lib for this in C#
>>>
>>> Meby you have exaples for C#?
>>>
>>> Kirill
>>>
>>>
>>> On Tue, 15 Jul 2008 18:09:20 GMT, "Preston Stephenson"
>>> <PStephenson@gw.novell.com> wrote:
>>>
>>>>I'm not sure if the javaClient from the SOAP SDK has this example.
>>>>I've attached what we do for SSL. When we try SSL, it the user
>>>>hasn't seen the certificate before, we prompt them if they want
>>>>to accept the certificate. If they accept the certificate, we don't
>>>>prompt them any more for that certificate. Let me know if you
>>>>have questions.
>>>>
>>>>I've posted the source out to:
>>>>ftp://ftp.novell.com/outgoing/ssl.zip
>>>>
>>>>Let me know if you have questions.
>>>>Preston
>>>>
>>>>>>> On Tuesday, July 15, 2008 at 6:11 AM, Ray<ray@test.de> wrote:
>>>>
>>>>> Hey Krill,
>>>>>
>>>>> in Java I needed to disable client side certificate checking.
>>>>> As most companies don't use Ver*S*gn trused certs for
>>>>> their internal servers... ( i.e. the POA cert is self signed, thus

not
>>>>trust
>>>>>
>>>>> worthy )
>>>>>
>>>>> Ray.
>>>>>
>>>>> "Kirill" <Kirill@skypro.ch> schrieb im Newsbeitrag
>>>>> news:t8po741gooottnuanvjhf8l1usko0dkvs2@4ax.com...
>>>>>> Hello
>>>>>>
>>>>>> All big companies open SOAP port only when using SSL
>>>>>>
>>>>>> This means that my programm MUST be able to use SSL
>>>>>>
>>>>>> I would hope that this is simply setting one more switch when

starting
>>>>>> communication with SOAP !
>>>>>>
>>>>>> Sou i jost add this string
>>>>>> if (Settings[GlobalVars.gw_srv_ssl].Equals("1")) { str =
>>>>>> "https://"; } else { str = "http://"; }
>>>>>>
>>>>>>
>>>>>> i'm used
>>>>>>
>>>>>> public bool LoginToGW(string GWName1, string GWUser1, string

GWPort1,
>>>>>> string GWPass1)
>>>>>> {//if (LoginToGW(GWName,GWUser,GWPort,GWPass)
>>>>>> ws = null;
>>>>>>
>>>>>> String str = "";
>>>>>> GWReference.loginRequest req = new
>>>>>> GWReference.loginRequest();
>>>>>> GWReference.loginResponse resp;
>>>>>> GWReference.PlainText pt = new GWReference.PlainText();
>>>>>>
>>>>>> ws = new GWReference.GroupWiseBinding();
>>>>>>
>>>>>>
>>>>>> if (Settings[GlobalVars.gw_srv_ssl].Equals("1")) { str =
>>>>>> "https://"; } else { str = "http://"; }
>>>>>> str += GWName1;
>>>>>> str += ":";
>>>>>> str += GWPort1;
>>>>>>
>>>>>> str += "/soap";
>>>>>>
>>>>>> ws.Url = str;
>>>>>>
>>>>>> pt.username = GWUser1;
>>>>>> pt.password = GWPass1;
>>>>>> req.auth = pt;
>>>>>>
>>>>>> try
>>>>>> {
>>>>>> resp = ws.loginRequest(req);
>>>>>>
>>>>>> if (0 == resp.status.code)
>>>>>> {
>>>>>> ws.session = new GWReference.@string();
>>>>>> ws.session.Text = new String[1];
>>>>>> ws.session.Text[0] = resp.session;
>>>>>> ws = null;
>>>>>> return true;
>>>>>>
>>>>>> }
>>>>>> }
>>>>>> catch (Exception e)
>>>>>> {
>>>>>> msgStatus = e.Message;
>>>>>> ws = null;
>>>>>> }
>>>>>> }
>>>>>>
>>>>>> But after resp = ws.loginRequest(req); i resive Exception
>>>>>> "The underlying connection was closed: Could not establish trust
>>>>>> relationship for the SSL/TLS secure channel."
>>>>>>
>>>>>> Can you help me???
>>>>>>
>>>>>>
>>>>>> Kirill

0 Likes
SamSlocum Absent Member.
Absent Member.

Re: SOAP communication using SSL

Hi Preston,

I know this is a pretty old thread, but is that ssl c# code still available anywhere? I tried following the link and it does not appear to be available there any longer.

Thanks,

Sam

Preston Stephenson;1756355 wrote:
I've copied some test code to:
ftp://ftp.novell.com/outgoing/vcsClient.zip

It needs some work. It prompted me twice for the certificate.

Preston

>>> On Wednesday, July 16, 2008 at 3:53 AM, Kirill<Kirill@skypro.ch> wrote:

> Hello Preston
>
> java its good
> But me need code in C#
>
> Like i understood me need rewrite this part of code
>
>
> if ( null == SSLFactory ) {
> SSLContext ctx;
> MyHostNameVerifier hv = new
> MyHostNameVerifier();
> MyTrustManager tm = new
> MyTrustManager();
> TrustManager mytm[] = { tm };
>
> ctx = SSLContext.getInstance( "SSL" );
>
> ctx.init( null, mytm, null );
> SSLFactory = ctx.getSocketFactory();
> HttpsURLConnection.setDefaultSSLSocketFactory(
> SSLFactory );
> HttpsURLConnection.setDefaultHostnameVerifier( hv );
> }
>
>
> but i can't find meny Lib for this in C#
>
> Meby you have exaples for C#?
>
> Kirill
>
>
> On Tue, 15 Jul 2008 18:09:20 GMT, "Preston Stephenson"
> <PStephenson@gw.novell.com> wrote:
>
>>I'm not sure if the javaClient from the SOAP SDK has this example.
>>I've attached what we do for SSL. When we try SSL, it the user
>>hasn't seen the certificate before, we prompt them if they want
>>to accept the certificate. If they accept the certificate, we don't
>>prompt them any more for that certificate. Let me know if you
>>have questions.
>>
>>I've posted the source out to:
>>ftp://ftp.novell.com/outgoing/ssl.zip
>>
>>Let me know if you have questions.
>>Preston
>>
>>>>> On Tuesday, July 15, 2008 at 6:11 AM, Ray<ray@test.de> wrote:

>>
>>> Hey Krill,
>>>
>>> in Java I needed to disable client side certificate checking.
>>> As most companies don't use Ver*S*gn trused certs for
>>> their internal servers... ( i.e. the POA cert is self signed, thus not

>>trust
>>>
>>> worthy )
>>>
>>> Ray.
>>>
>>> "Kirill" <Kirill@skypro.ch> schrieb im Newsbeitrag
>>> news:t8po741gooottnuanvjhf8l1usko0dkvs2@4ax.com...
>>>> Hello
>>>>
>>>> All big companies open SOAP port only when using SSL
>>>>
>>>> This means that my programm MUST be able to use SSL
>>>>
>>>> I would hope that this is simply setting one more switch when starting
>>>> communication with SOAP !
>>>>
>>>> Sou i jost add this string
>>>> if (Settings[GlobalVars.gw_srv_ssl].Equals("1")) { str =
>>>> "https://"; } else { str = "http://"; }
>>>>
>>>>
>>>> i'm used
>>>>
>>>> public bool LoginToGW(string GWName1, string GWUser1, string GWPort1,
>>>> string GWPass1)
>>>> {//if (LoginToGW(GWName,GWUser,GWPort,GWPass)
>>>> ws = null;
>>>>
>>>> String str = "";
>>>> GWReference.loginRequest req = new
>>>> GWReference.loginRequest();
>>>> GWReference.loginResponse resp;
>>>> GWReference.PlainText pt = new GWReference.PlainText();
>>>>
>>>> ws = new GWReference.GroupWiseBinding();
>>>>
>>>>
>>>> if (Settings[GlobalVars.gw_srv_ssl].Equals("1")) { str =
>>>> "https://"; } else { str = "http://"; }
>>>> str += GWName1;
>>>> str += ":";
>>>> str += GWPort1;
>>>>
>>>> str += "/soap";
>>>>
>>>> ws.Url = str;
>>>>
>>>> pt.username = GWUser1;
>>>> pt.password = GWPass1;
>>>> req.auth = pt;
>>>>
>>>> try
>>>> {
>>>> resp = ws.loginRequest(req);
>>>>
>>>> if (0 == resp.status.code)
>>>> {
>>>> ws.session = new GWReference.@string();
>>>> ws.session.Text = new String[1];
>>>> ws.session.Text[0] = resp.session;
>>>> ws = null;
>>>> return true;
>>>>
>>>> }
>>>> }
>>>> catch (Exception e)
>>>> {
>>>> msgStatus = e.Message;
>>>> ws = null;
>>>> }
>>>> }
>>>>
>>>> But after resp = ws.loginRequest(req); i resive Exception
>>>> "The underlying connection was closed: Could not establish trust
>>>> relationship for the SSL/TLS secure channel."
>>>>
>>>> Can you help me???
>>>>
>>>>
>>>> Kirill
0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: SOAP communication using SSL

Sorry, I'm away from work. I'll need to look for it on
Monday.

>>> On Friday, August 28, 2009 at 12:06 PM,

SamSlocum<SamSlocum@no-mx.forums.novell.com> wrote:

> Hi Preston,
>
> I know this is a pretty old thread, but is that ssl c# code still
> available anywhere? I tried following the link and it does not appear
> to be available there any longer.
>
> Thanks,
>
> Sam
>
> Preston Stephenson;1756355 Wrote:
>> I've copied some test code to:
>> ftp://ftp.novell.com/outgoing/vcsClient.zip
>>
>> It needs some work. It prompted me twice for the certificate.
>>
>> Preston
>>
>> >>> On Wednesday, July 16, 2008 at 3:53 AM, Kirill<Kirill@skypro.ch>

>> wrote:
>> > Hello Preston
>> >
>> > java its good
>> > But me need code in C#
>> >
>> > Like i understood me need rewrite this part of code
>> >
>> >
>> > if ( null == SSLFactory ) {
>> > SSLContext ctx;
>> > MyHostNameVerifier hv = new
>> > MyHostNameVerifier();
>> > MyTrustManager tm = new
>> > MyTrustManager();
>> > TrustManager mytm[] = { tm };
>> >
>> > ctx = SSLContext.getInstance( "SSL" );
>> >
>> > ctx.init( null, mytm, null );
>> > SSLFactory = ctx.getSocketFactory();
>> > HttpsURLConnection.setDefaultSSLSocketFactory(
>> > SSLFactory );
>> > HttpsURLConnection.setDefaultHostnameVerifier( hv );
>> > }
>> >
>> >
>> > but i can't find meny Lib for this in C#
>> >
>> > Meby you have exaples for C#?
>> >
>> > Kirill
>> >
>> >
>> > On Tue, 15 Jul 2008 18:09:20 GMT, "Preston Stephenson"
>> > <PStephenson@gw.novell.com> wrote:
>> >
>> >>I'm not sure if the javaClient from the SOAP SDK has this example.
>> >>I've attached what we do for SSL. When we try SSL, it the user
>> >>hasn't seen the certificate before, we prompt them if they want
>> >>to accept the certificate. If they accept the certificate, we don't
>> >>prompt them any more for that certificate. Let me know if you
>> >>have questions.
>> >>
>> >>I've posted the source out to:
>> >>ftp://ftp.novell.com/outgoing/ssl.zip
>> >>
>> >>Let me know if you have questions.
>> >>Preston
>> >>
>> >>>>> On Tuesday, July 15, 2008 at 6:11 AM, Ray<ray@test.de> wrote:
>> >>
>> >>> Hey Krill,
>> >>>
>> >>> in Java I needed to disable client side certificate checking.
>> >>> As most companies don't use Ver*S*gn trused certs for
>> >>> their internal servers... ( i.e. the POA cert is self signed, thus

>> not
>> >>trust
>> >>>
>> >>> worthy )
>> >>>
>> >>> Ray.
>> >>>
>> >>> "Kirill" <Kirill@skypro.ch> schrieb im Newsbeitrag
>> >>> news:t8po741gooottnuanvjhf8l1usko0dkvs2@4ax.com...
>> >>>> Hello
>> >>>>
>> >>>> All big companies open SOAP port only when using SSL
>> >>>>
>> >>>> This means that my programm MUST be able to use SSL
>> >>>>
>> >>>> I would hope that this is simply setting one more switch when

>> starting
>> >>>> communication with SOAP !
>> >>>>
>> >>>> Sou i jost add this string
>> >>>> if (Settings[GlobalVars.gw_srv_ssl].Equals("1")) { str

>> =
>> >>>> "https://"; } else { str = "http://"; }
>> >>>>
>> >>>>
>> >>>> i'm used
>> >>>>
>> >>>> public bool LoginToGW(string GWName1, string GWUser1, string

>> GWPort1,
>> >>>> string GWPass1)
>> >>>> {//if (LoginToGW(GWName,GWUser,GWPort,GWPass)
>> >>>> ws = null;
>> >>>>
>> >>>> String str = "";
>> >>>> GWReference.loginRequest req = new
>> >>>> GWReference.loginRequest();
>> >>>> GWReference.loginResponse resp;
>> >>>> GWReference.PlainText pt = new

>> GWReference.PlainText();
>> >>>>
>> >>>> ws = new GWReference.GroupWiseBinding();
>> >>>>
>> >>>>
>> >>>> if (Settings[GlobalVars.gw_srv_ssl].Equals("1")) { str

>> =
>> >>>> "https://"; } else { str = "http://"; }
>> >>>> str += GWName1;
>> >>>> str += ":";
>> >>>> str += GWPort1;
>> >>>>
>> >>>> str += "/soap";
>> >>>>
>> >>>> ws.Url = str;
>> >>>>
>> >>>> pt.username = GWUser1;
>> >>>> pt.password = GWPass1;
>> >>>> req.auth = pt;
>> >>>>
>> >>>> try
>> >>>> {
>> >>>> resp = ws.loginRequest(req);
>> >>>>
>> >>>> if (0 == resp.status.code)
>> >>>> {
>> >>>> ws.session = new GWReference.@string();
>> >>>> ws.session.Text = new String[1];
>> >>>> ws.session.Text[0] = resp.session;
>> >>>> ws = null;
>> >>>> return true;
>> >>>>
>> >>>> }
>> >>>> }
>> >>>> catch (Exception e)
>> >>>> {
>> >>>> msgStatus = e.Message;
>> >>>> ws = null;
>> >>>> }
>> >>>> }
>> >>>>
>> >>>> But after resp = ws.loginRequest(req); i resive Exception
>> >>>> "The underlying connection was closed: Could not establish trust
>> >>>> relationship for the SSL/TLS secure channel."
>> >>>>
>> >>>> Can you help me???
>> >>>>
>> >>>>
>> >>>> Kirill

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: SOAP communication using SSL

I'm not sure if this is the same, but
I copied it out to:

ftp://ftp.novell.com/outgoing/vcsClient.zip

Preston


>>> On Friday, August 28, 2009 at 12:17 PM, Preston

Stephenson<PStephenson@gw.novell.com> wrote:
> Sorry, I'm away from work. I'll need to look for it on
> Monday.
>
>>>> On Friday, August 28, 2009 at 12:06 PM,

> SamSlocum<SamSlocum@no‑mx.forums.novell.com> wrote:
>
>> Hi Preston,
>>
>> I know this is a pretty old thread, but is that ssl c# code still
>> available anywhere? I tried following the link and it does not appear
>> to be available there any longer.
>>
>> Thanks,
>>
>> Sam
>>
>> Preston Stephenson;1756355 Wrote:
>>> I've copied some test code to:
>>> ftp://ftp.novell.com/outgoing/vcsClient.zip
>>>
>>> It needs some work. It prompted me twice for the certificate.
>>>
>>> Preston
>>>
>>> >>> On Wednesday, July 16, 2008 at 3:53 AM, Kirill<Kirill@skypro.ch>
>>> wrote:
>>> > Hello Preston
>>> >
>>> > java its good
>>> > But me need code in C#
>>> >
>>> > Like i understood me need rewrite this part of code
>>> >
>>> >
>>> > if ( null == SSLFactory ) {
>>> > SSLContext ctx;
>>> > MyHostNameVerifier hv = new
>>> > MyHostNameVerifier();
>>> > MyTrustManager tm = new
>>> > MyTrustManager();
>>> > TrustManager mytm[] = { tm };
>>> >
>>> > ctx = SSLContext.getInstance( "SSL" );
>>> >
>>> > ctx.init( null, mytm, null );
>>> > SSLFactory = ctx.getSocketFactory();
>>> > HttpsURLConnection.setDefaultSSLSocketFactory(
>>> > SSLFactory );
>>> > HttpsURLConnection.setDefaultHostnameVerifier( hv );
>>> > }
>>> >
>>> >
>>> > but i can't find meny Lib for this in C#
>>> >
>>> > Meby you have exaples for C#?
>>> >
>>> > Kirill
>>> >
>>> >
>>> > On Tue, 15 Jul 2008 18:09:20 GMT, "Preston Stephenson"
>>> > <PStephenson@gw.novell.com> wrote:
>>> >
>>> >>I'm not sure if the javaClient from the SOAP SDK has this example.
>>> >>I've attached what we do for SSL. When we try SSL, it the user
>>> >>hasn't seen the certificate before, we prompt them if they want
>>> >>to accept the certificate. If they accept the certificate, we don't
>>> >>prompt them any more for that certificate. Let me know if you
>>> >>have questions.
>>> >>
>>> >>I've posted the source out to:
>>> >>ftp://ftp.novell.com/outgoing/ssl.zip
>>> >>
>>> >>Let me know if you have questions.
>>> >>Preston
>>> >>
>>> >>>>> On Tuesday, July 15, 2008 at 6:11 AM, Ray<ray@test.de> wrote:
>>> >>
>>> >>> Hey Krill,
>>> >>>
>>> >>> in Java I needed to disable client side certificate checking.
>>> >>> As most companies don't use Ver*S*gn trused certs for
>>> >>> their internal servers... ( i.e. the POA cert is self signed, thus
>>> not
>>> >>trust
>>> >>>
>>> >>> worthy )
>>> >>>
>>> >>> Ray.
>>> >>>
>>> >>> "Kirill" <Kirill@skypro.ch> schrieb im Newsbeitrag
>>> >>> news:t8po741gooottnuanvjhf8l1usko0dkvs2@4ax.com...
>>> >>>> Hello
>>> >>>>
>>> >>>> All big companies open SOAP port only when using SSL
>>> >>>>
>>> >>>> This means that my programm MUST be able to use SSL
>>> >>>>
>>> >>>> I would hope that this is simply setting one more switch when
>>> starting
>>> >>>> communication with SOAP !
>>> >>>>
>>> >>>> Sou i jost add this string
>>> >>>> if (Settings[GlobalVars.gw_srv_ssl].Equals("1")) { str
>>> =
>>> >>>> "https://"; } else { str = "http://"; }
>>> >>>>
>>> >>>>
>>> >>>> i'm used
>>> >>>>
>>> >>>> public bool LoginToGW(string GWName1, string GWUser1, string
>>> GWPort1,
>>> >>>> string GWPass1)
>>> >>>> {//if (LoginToGW(GWName,GWUser,GWPort,GWPass)
>>> >>>> ws = null;
>>> >>>>
>>> >>>> String str = "";
>>> >>>> GWReference.loginRequest req = new
>>> >>>> GWReference.loginRequest();
>>> >>>> GWReference.loginResponse resp;
>>> >>>> GWReference.PlainText pt = new
>>> GWReference.PlainText();
>>> >>>>
>>> >>>> ws = new GWReference.GroupWiseBinding();
>>> >>>>
>>> >>>>
>>> >>>> if (Settings[GlobalVars.gw_srv_ssl].Equals("1")) { str
>>> =
>>> >>>> "https://"; } else { str = "http://"; }
>>> >>>> str += GWName1;
>>> >>>> str += ":";
>>> >>>> str += GWPort1;
>>> >>>>
>>> >>>> str += "/soap";
>>> >>>>
>>> >>>> ws.Url = str;
>>> >>>>
>>> >>>> pt.username = GWUser1;
>>> >>>> pt.password = GWPass1;
>>> >>>> req.auth = pt;
>>> >>>>
>>> >>>> try
>>> >>>> {
>>> >>>> resp = ws.loginRequest(req);
>>> >>>>
>>> >>>> if (0 == resp.status.code)
>>> >>>> {
>>> >>>> ws.session = new GWReference.@string();
>>> >>>> ws.session.Text = new String[1];
>>> >>>> ws.session.Text[0] = resp.session;
>>> >>>> ws = null;
>>> >>>> return true;
>>> >>>>
>>> >>>> }
>>> >>>> }
>>> >>>> catch (Exception e)
>>> >>>> {
>>> >>>> msgStatus = e.Message;
>>> >>>> ws = null;
>>> >>>> }
>>> >>>> }
>>> >>>>
>>> >>>> But after resp = ws.loginRequest(req); i resive Exception
>>> >>>> "The underlying connection was closed: Could not establish trust
>>> >>>> relationship for the SSL/TLS secure channel."
>>> >>>>
>>> >>>> Can you help me???
>>> >>>>
>>> >>>>
>>> >>>> Kirill

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.