gtg092x / gulp-sftp

Gulp SFTP Deploy
140 stars 61 forks source link

How to work with pem #27

Closed unbug closed 9 years ago

unbug commented 9 years ago

I am using pem to create private keys and certificates for this plugin. Such as:


var pem = require('pem');
gulp.task('deploy_test', function(cb) {
    pem.createCertificate({}, function (e, r) {
        return gulp.src(distPath+'*')
            .pipe(sftp({
                host: '172.28.2.33',
                port: 22,
                user: 'myname',
                pass: 'mypass',
                secure: true,
                key: r.clientKey,
                cert: r.certificate,
            }));
    });
});

Can it be possible?

gtg092x commented 9 years ago

Never tested it, but you should be able to use keyContents - this also looks like the wrong name to use! I'll make an update that uses the parameter cert. keyContents will remain for legacy reasons, but cert will be used in the future.

For now, use keyContents

unbug commented 9 years ago

Thank you,can you give pem a test?I can't find any grunt or gulp plugin support this.

unbug commented 9 years ago

Change to keyContents works very well ;),please keep keyContents after use cert.

gtg092x commented 9 years ago

That's the plan. Thanks! On Mar 11, 2015 7:06 PM, "unbug" notifications@github.com wrote:

Change to keyContents works very well ;),please keep keyContents after use cert.

— Reply to this email directly or view it on GitHub https://github.com/gtg092x/gulp-sftp/issues/27#issuecomment-78411275.

unbug commented 9 years ago

I‘ve fire you a PR for work with pem sample.