본문 바로가기

Spring34

useInsecureTrustManager 옵션 Spring Cloud Gateway 에서 useInsecureTrustManager 옵션 디폴트는 false 다. Spring Cloud Gateway 가이드는 보안 이유로 true로 설정하는건 production 에 적합하지 않다고 한다. cloud.spring.io/spring-cloud-gateway/multi/multi__tls_ssl.html 7. TLS / SSL The Gateway can listen for requests on https by following the usual Spring server configuration. Example: Gateway routes can be routed to both http and https backends. If routing to a ht.. 2021. 1. 20.
request body memory leak 평화롭던 서버에서 갑자기 reactor-netty out of direct memory error 다수 발생했다. 따로 설정을 한게 없어서 direct memory max 가 1G 인데 초과된것이다. ERROR default c.n.s.p.GlobalErrorWebExceptionHandler - [GlobalErrorWebExceptionHandler] ETC reactor.netty.ReactorNetty$InternalNettyException: io.netty.util.internal.OutOfDirectMemoryError: failed to allocate 16777216 byte(s) of direct memory (used: 1056964615, max: 1073741824) Suppres.. 2021. 1. 20.
개발 이슈 모음 1. Spring Security X-Frame-Options 이슈 Default Security Headers Cache-Control: no-cache, no-store, max-age=0, must-revalidate Pragma: no-cache Expires: 0 X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000 ; includeSubDomains X-Frame-Options: DENY X-XSS-Protection: 1; mode=block cf) Strict-Transport-Security는 HTTPS 요청일때만 추가된다. X-Frame-Options: DENY response header에 X-Frame.. 2021. 1. 19.
WebClient 사용할때 주의 (1편) 헤더 누적 미리 webClient 를 생성해놓고 필요할 때마다 재사용을 할 때 this.webClient = WebClient.builder() .clientConnector(connector) .baseUrl("https://yangbongsoo.tistory.com") .build() .post(); 사용하고자 하는 쪽에서 아래와 같이 header 메서드를 쓴다면 reqest header 가 계속 누적되어 append 되는 문제가 발생한다. this.webClient .uri(uriBuilder -> uriBuilder .path("/api") .queryParam("txId", route.getId() + "-" + System.currentTimeMillis()) .build() ) .header.. 2021. 1. 18.