Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

should expose get_certkey method #10

Closed
yxy opened this issue Jun 11, 2020 · 2 comments
Closed

should expose get_certkey method #10

yxy opened this issue Jun 11, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@yxy
Copy link

yxy commented Jun 11, 2020

first of all, awesome job. thanks for your kind work 👍 .

I need to check domain certkey exists or not, but I found this method only private.
It would be very convenient if this method can be exposed.

local autossl = require("resty.acme.autossl")
local certkey, err = autossl.get_certkey({domain=ngx.var.server_name, type="rsa"}) 
if certkey and scheme == http then
    ngx.redirect(new_uri, 301)
end

-- I had to hack autoss.lua to make this work

-- make get_certkey visible
AUTOSSL.get_certkey = get_certkey 
@fffonion fffonion added the enhancement New feature or request label Sep 8, 2020
@fffonion
Copy link
Owner

fffonion commented Sep 8, 2020

This has been implemented and will be included in next release : )

@fffonion fffonion closed this as completed Sep 8, 2020
@fffonion
Copy link
Owner

fffonion commented Sep 8, 2020

@yxy the exposed function is slightly different from internal version, please refer to doc https://github.com/fffonion/lua-resty-acme#autosslget_certkey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants