Demo entry 6633598

1

   

Submitted by anonymous on Aug 04, 2017 at 03:32
Language: Tcl. Code size: 1.3 kB.

proc cmd::NewClientReq {} {
    
    debug::msg "cmd::NewClientReq"
    
    #now in openssl::
    #variable cmd
    #global config_file
    
    # request attributes
    
    array set attr [Dialog_AskAttributes .popup {New Client Certificate Request} {
	CN {Common Name (eg, John Doe) *} {} "!"
	emailAddress {Email Address *} {} "!" }]
	
    if {$attr(exit) == "ok"} {
	
	set attr(csr_fn) [tk_getSaveFile -defaultextension .csr \
	  -filetypes {
	    {{Certificate Signing Requests} {.csr}}
	    {{All Files} *}
	} \
	  -initialdir certificates \
	  -initialfile $attr(emailAddress).csr \
	  -title "Enter file name to save CSR"]
    }

    if {$attr(exit) == "ok" && $attr(csr_fn) != ""} {
	
	# key filename = csr filename, but in stead .key extension.
	regsub {\.csr$} $attr(csr_fn) {} attr(fn)
	
	update
	
	# create client request
	openssl::do client_key "" attr
	openssl::do client_req newclient attr
	
	#set f [open "config.cfg" w]
	#puts $f [subst -nocommands -nobackslashes $config_file(newclient)]
	#close $f
	##catch {eval exec [subst $cmd(client_key)]}
	##catch {eval exec [subst $cmd(client_req)]}
	#openssl [subst $cmd(client_key)]
	#openssl [subst $cmd(client_req)]
	#catch {file delete "config.cfg"}

    } 

}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).