Spring netflix 服务器配置未 returns 密钥加密

Spring netflix server config not returns key encripted

我正在为 Spring Netflix 创建服务器配置。我配置了 POM.XML 并添加了安全依赖项。我还配置了 application.yml 和 bootstrap.yml 文件。当我使用 returns 加密密钥的加密命令调用服务器时,服务器响应:

Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Thu Jul 23 10:20:46 CEST 2015 There was an unexpected error (type=Not Found, status=404). No message available

来电:

http://user:s3cret@localhost:8888/encrypt -d s3cret

Maven 控制台:

2015-07-23 11:02:05.217 INFO 7948 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8888 (http) 2015-07-23 11:02:05.218 INFO 7948 --- [ main] nubbler.netflixserver.ConfigServerApp : Started ConfigServerApp in 5.106 seconds (JVM running for 5.922) 2015-07-23 11:02:13.765 INFO 7948 --- [nio-8888-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring FrameworkServlet 'dispatcherServlet' 2015-07-23 11:02:13.766 INFO 7948 --- [nio-8888-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization started 2015-07-23 11:02:13.785 INFO 7948 --- [nio-8888-exec-1] o.s.web.servlet.DispatcherServlet
: FrameworkServlet 'dispatcherServlet': initialization completed in 19 ms 2015-07-23 11:02:13.885 INFO 7948 --- [nio-8888-exec-1] o.s.b.a.audit.listener.AuditListener : AuditEvent [timestamp=Thu Jul 23 11:02:13 CEST 2015, principal=user, type=AUTHENTICATION_SUCCESS, data={details=org.springframework.security.web.authentication.WebAuthenticationDetails@b364: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: null}]

¿有什么想法吗?我已经在 jdk (jdk_1.8.0_40) 中安装了 JCE 扩展,我已经检查了应用程序和 Maven 使用这个 jdk.

application.yml:

server:
  port: 8888

spring:
   cloud:
      config:
         server:
            git:
               uri: https://github.com/xxxxx
               basedir: target/config
   security:
      user:
         password: s3cret

bootstrap.yml:

spring:
  encrypt:
   key: foobar

POM.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>nubbler</groupId>
    <artifactId>netflixserver</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.2.5.RELEASE</version>
    </parent>

    <name>netflixserver</name>
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-netflix</artifactId>
                <version>1.0.3.RELEASE</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-config-server</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>

    </dependencies>
</project>

我在调用时使用 Curl 解决了它。

在我尝试使用浏览器 (Chrome) 和 SoapUI 之前,两个服务器都响应错误。