web stats
sftp connection issue - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 11-25-2014, 03:28 AM
Garry.Robertson Garry.Robertson is offline
Mirth Newb
 
Join Date: May 2011
Posts: 7
Garry.Robertson is on a distinguished road
Default sftp connection issue

I am having an issue connecting to a sftp server as a file writer destination.
If I use winscp then I can connect successfully if I change the preferred sftp protocol version to 3, from the default value of 5.
Using mirth I get an algorithm error and it fails to connect.
is there a way to change the sftp protocol version in mirth or has anyone resolved this issue?

I am using mirth connect v2.X
Reply With Quote
  #2  
Old 11-25-2014, 01:25 PM
rts rts is offline
Mirth Guru
 
Join Date: Feb 2008
Posts: 215
rts is an unknown quantity at this point
Default

You may want to try a Javascript writer using JSCH.
Take a look at:
http://epaul.github.io/jsch-document...annelSftp.html

Here is a snip of code from my Mirth JS writer to use JSCH:


importPackage(com.jcraft.jsch);
importPackage(java.io);
importPackage(java.lang);

var retry = 0;
var errorCond = 'false';

var f1 = new File($('OUTBOX') + '/' + $('SINGLE_FILE_NAME'));
var port = $('DEST_PORT');
if(port == '' || port == null)
port = 22;

do {

try {

var jsch = new JSch();

jsch.setConfig('StrictHostKeyChecking','no');
var session = jsch.getSession($('USER'),$('DEST_IP'),port);
session.setPassword($('PASS'));
session.setTimeout(30000)
session.connect();
var channel = session.openChannel('sftp');
channel.connect();

channel.cd($('DEST_FOLDER'));
channel.put(new FileInputStream(f1), $('SINGLE_FILE_NAME'));

session.disconnect();
errorCond = 'false';
break;
}
catch(err) {
logger.info('IN JSCH SFTP ERR : ' + err);
//throw(err);
retry++;
if(retry > 10) {
throw(err);
break;
}
sleep(6);
logger.info('HUB--> in SFTP Sender , retrying...' + retry.toString());
errorCond = 'true';
}
}
while (errorCond == 'true');
Reply With Quote
  #3  
Old 12-15-2014, 12:20 AM
Garry.Robertson Garry.Robertson is offline
Mirth Newb
 
Join Date: May 2011
Posts: 7
Garry.Robertson is on a distinguished road
Default SFTP Algorithm issue

Hi, thanks for the reply, but I am looking for an answer as to whether Mirth Connect has limitations with SFTP.


Has anyone else had issues with SFTP connections?
Reply With Quote
Reply

Tags
sftp

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 08:06 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation