mirror of https://github.com/jellyfin/jellyfin.git
add password to self signed cert
This commit is contained in:
parent
dbfb1fb370
commit
fc788efa49
|
@ -1138,7 +1138,7 @@ namespace Emby.Server.Core
|
||||||
|
|
||||||
// Generate self-signed cert
|
// Generate self-signed cert
|
||||||
var certHost = GetHostnameFromExternalDns(ServerConfigurationManager.Configuration.WanDdns);
|
var certHost = GetHostnameFromExternalDns(ServerConfigurationManager.Configuration.WanDdns);
|
||||||
var certPath = Path.Combine(ServerConfigurationManager.ApplicationPaths.ProgramDataPath, "ssl", "cert_" + (certHost + "1").GetMD5().ToString("N") + ".pfx");
|
var certPath = Path.Combine(ServerConfigurationManager.ApplicationPaths.ProgramDataPath, "ssl", "cert_" + (certHost + "2").GetMD5().ToString("N") + ".pfx");
|
||||||
var password = "embycert";
|
var password = "embycert";
|
||||||
|
|
||||||
if (generateCertificate)
|
if (generateCertificate)
|
||||||
|
|
|
@ -165,7 +165,10 @@ namespace Emby.Server.Implementations.Library
|
||||||
ExcludeItemTypes = excludeItemTypes.ToArray(),
|
ExcludeItemTypes = excludeItemTypes.ToArray(),
|
||||||
IncludeItemTypes = includeItemTypes.ToArray(),
|
IncludeItemTypes = includeItemTypes.ToArray(),
|
||||||
Limit = query.Limit,
|
Limit = query.Limit,
|
||||||
IncludeItemsByName = true
|
IncludeItemsByName = string.IsNullOrWhiteSpace(query.ParentId),
|
||||||
|
ParentId = string.IsNullOrWhiteSpace(query.ParentId) ? (Guid?)null : new Guid(query.ParentId),
|
||||||
|
SortBy = new[] { ItemSortBy.SortName },
|
||||||
|
Recursive = true
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add search hints based on item name
|
// Add search hints based on item name
|
||||||
|
|
|
@ -66,6 +66,8 @@ namespace MediaBrowser.Api
|
||||||
[ApiMember(Name = "IncludeItemTypes", Description = "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimeted.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)]
|
[ApiMember(Name = "IncludeItemTypes", Description = "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimeted.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)]
|
||||||
public string IncludeItemTypes { get; set; }
|
public string IncludeItemTypes { get; set; }
|
||||||
|
|
||||||
|
public string ParentId { get; set; }
|
||||||
|
|
||||||
public GetSearchHints()
|
public GetSearchHints()
|
||||||
{
|
{
|
||||||
IncludeArtists = true;
|
IncludeArtists = true;
|
||||||
|
@ -135,7 +137,8 @@ namespace MediaBrowser.Api
|
||||||
IncludeStudios = request.IncludeStudios,
|
IncludeStudios = request.IncludeStudios,
|
||||||
StartIndex = request.StartIndex,
|
StartIndex = request.StartIndex,
|
||||||
UserId = request.UserId,
|
UserId = request.UserId,
|
||||||
IncludeItemTypes = (request.IncludeItemTypes ?? string.Empty).Split(',').Where(i => !string.IsNullOrWhiteSpace(i)).ToArray()
|
IncludeItemTypes = (request.IncludeItemTypes ?? string.Empty).Split(',').Where(i => !string.IsNullOrWhiteSpace(i)).ToArray(),
|
||||||
|
ParentId = request.ParentId
|
||||||
|
|
||||||
}).ConfigureAwait(false);
|
}).ConfigureAwait(false);
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,7 @@ namespace MediaBrowser.Model.Search
|
||||||
public bool IncludeArtists { get; set; }
|
public bool IncludeArtists { get; set; }
|
||||||
|
|
||||||
public string[] IncludeItemTypes { get; set; }
|
public string[] IncludeItemTypes { get; set; }
|
||||||
|
public string ParentId { get; set; }
|
||||||
|
|
||||||
public SearchQuery()
|
public SearchQuery()
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,7 +44,7 @@ namespace Emby.Common.Implementations.Security
|
||||||
cb.NotAfter = notAfter;
|
cb.NotAfter = notAfter;
|
||||||
cb.SubjectName = subject;
|
cb.SubjectName = subject;
|
||||||
cb.SubjectPublicKey = subjectKey;
|
cb.SubjectPublicKey = subjectKey;
|
||||||
|
|
||||||
// signature
|
// signature
|
||||||
cb.Hash = "SHA256";
|
cb.Hash = "SHA256";
|
||||||
byte[] rawcert = cb.Sign(issuerKey);
|
byte[] rawcert = cb.Sign(issuerKey);
|
||||||
|
@ -60,6 +60,7 @@ namespace Emby.Common.Implementations.Security
|
||||||
attributes.Add(PKCS9.localKeyId, list);
|
attributes.Add(PKCS9.localKeyId, list);
|
||||||
|
|
||||||
p12.AddCertificate(new X509Certificate(rawcert), attributes);
|
p12.AddCertificate(new X509Certificate(rawcert), attributes);
|
||||||
|
p12.Password = password;
|
||||||
|
|
||||||
p12.AddPkcs8ShroudedKeyBag(subjectKey, attributes);
|
p12.AddPkcs8ShroudedKeyBag(subjectKey, attributes);
|
||||||
p12.SaveToFile(fileName);
|
p12.SaveToFile(fileName);
|
||||||
|
|
Loading…
Reference in New Issue