Comparison

net/server_epoll.lua @ 12542:5ec9d6913162

net.server: Fix multiple return values return foo and foo() crops multiple return values to a single one, so any second return values etc were last, mostly error details. Introduced in 7e9ebdc75ce4
author Kim Alvefur <zash@zash.se>
date Fri, 03 Jun 2022 17:51:42 +0200
parent 12515:76c1725f4467
child 12594:29685403be32
comparison
equal deleted inserted replaced
12541:97af41d580f7 12542:5ec9d6913162
625 return self.tls_ctx 625 return self.tls_ctx
626 end 626 end
627 627
628 function interface:ssl_info() 628 function interface:ssl_info()
629 local sock = self.conn; 629 local sock = self.conn;
630 return sock.info and sock:info(); 630 if not sock.info then return nil, "not-implemented"; end
631 return sock:info();
631 end 632 end
632 633
633 function interface:ssl_peercertificate() 634 function interface:ssl_peercertificate()
634 local sock = self.conn; 635 local sock = self.conn;
635 return sock.getpeercertificate and sock:getpeercertificate(); 636 if not sock.getpeercertificate then return nil, "not-implemented"; end
637 return sock:getpeercertificate();
636 end 638 end
637 639
638 function interface:ssl_peerverification() 640 function interface:ssl_peerverification()
639 local sock = self.conn; 641 local sock = self.conn;
640 return sock.getpeerverification and sock:getpeerverification(); 642 if not sock.getpeerverification then return nil, { { "Chain verification not supported" } }; end
643 return sock:getpeerverification();
641 end 644 end
642 645
643 function interface:ssl_peerfinished() 646 function interface:ssl_peerfinished()
644 local sock = self.conn; 647 local sock = self.conn;
645 return sock.getpeerfinished and sock:getpeerfinished(); 648 if not sock.getpeerfinished then return nil, "not-implemented"; end
649 return sock:getpeerfinished();
646 end 650 end
647 651
648 function interface:starttls(tls_ctx) 652 function interface:starttls(tls_ctx)
649 if tls_ctx then self.tls_ctx = tls_ctx; end 653 if tls_ctx then self.tls_ctx = tls_ctx; end
650 self.starttls = false; 654 self.starttls = false;