bypass ssl certificate validation in subversion

前端 未结 4 644
被撕碎了的回忆
被撕碎了的回忆 2020-12-10 11:21

I\'m managing a subversion-based build system and we use a self-signed ssl for the server. So from time to time, we get build failures because a new machine has been added a

4条回答
  •  我在风中等你
    2020-12-10 11:42

    Another option is to use expect. Using expect you can simulate a user accepting the certificate. It will work when other options won't. I created this so that I could download code from svn in a Dockerfile.

    #!/usr/bin/expect -f
    
    set svn_username [lindex $argv 0]
    set svn_password [lindex $argv 1]
    set svn_url [lindex $argv 2]
    
    spawn svn --username=${svn_username} --password=${svn_password} list ${svn_url}
    expect "(R)eject, accept (t)emporarily or accept (p)ermanently? "
    send -- "p\r"
    expect "Store password unencrypted (yes/no)? "
    send "no\r"
    expect -re "root@.*:\/#"
    

提交回复
热议问题