EldoS | Feel safer!

Software components for data protection, secure storage and transfer

SimpleSSHClientX connect failure

Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.
#289
Posted: 05/22/2006 10:30:13
by Mike Scriven (Standard support level)
Joined: 05/19/2006
Posts: 102

I am evaluating SSHBlackBox. I have written a client app. using ElSimpleSSHClientX ActiveX control. The connect is failing with an error 501 - ERROR_SSH_CONNECTION_CANCELLED_BY_USER. I am using Visual C++ 6.0 with MFC. I have used the SimpleSftpDemo code as a sample. Here is my connect code in CMainFrame::OnFileOpen()

void CMainFrame::OnFileOpen()
{
/////////////////////////////////////////////////////////////////////////////
//
// Set license key
//
char* plainlicensekey = "1141...9211";
int keylen = strlen(plainlicensekey);
wchar_t* widelicensekey = (wchar_t*)malloc((keylen + 1) * 2);
memset(widelicensekey, 0, (keylen + 1) * 2);
keylen = MultiByteToWideChar(CP_ACP, 0, plainlicensekey, keylen, widelicensekey, keylen);
IElSBLicenseManagerX* pLicenseManager = NULL;
HRESULT hr = CoCreateInstance(CLSID_ElSBLicenseManagerX,
NULL,
CLSCTX_INPROC_SERVER,
IID_IElSBLicenseManagerX,
(void**)&pLicenseManager);
if (SUCCEEDED(hr)) {
BSTR str = SysAllocString(widelicensekey);
pLicenseManager->SetLicenseKey(str);
pLicenseManager->AddRef();
SysFreeString(str);
}
free(widelicensekey);

/////////////////////////////////////////////////////////////////////////////
//
// Connect to host
//
CElSimpleSSHClientX m_Client;
if (m_Client.Create(_T("Simple SSH Client Test"), 0, CRect(0, 0, 0, 0), this, IDC_ELSIMPLESSHCLIENTX))
{
m_Client.SetAddress(_T("arizona.princeton.edu"));
m_Client.SetPort(22);
m_Client.EnableAuthenticationType(SSH_AUTH_TYPE_KEYBOARD);
m_Client.SetUseInternalSocket(TRUE);
try
{
// opening connection
m_Client.Open();
}
catch(...)
{
AfxMessageBox(_T("Connection failed"));
}
}
}

If I cange this code to use ElSimpleSftpClientX it connects fine. Am I doing something wrong or is this a bug.

Thanks
#290
Posted: 05/22/2006 10:58:07
by Eugene Mayevski (EldoS Corp.)

Can it be that the server only allows SFTP connections (this is quite common) and not shell?


Sincerely yours
Eugene Mayevski
#291
Posted: 05/22/2006 11:00:51
by Mike Scriven (Standard support level)
Joined: 05/19/2006
Posts: 102

No, it's a Telnet connection and I can connect using the free PuTTY Telnet client.
#293
Posted: 05/22/2006 11:58:35
by Eugene Mayevski (EldoS Corp.)



Sincerely yours
Eugene Mayevski

Reply

Statistics

Topic viewed 4618 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!